예제 #1
0
func Program(fsh, vsh uint32) uint32 {
	p := gl.CreateProgram()
	gl.AttachShader(p, fsh)
	gl.AttachShader(p, vsh)
	gl.LinkProgram(p)

	var stat int32
	gl.GetProgramiv(p, gl.LINK_STATUS, &stat)

	if stat == 0 {
		var s = make([]byte, 1000)
		var length gl.Sizei
		_log := string(s)
		gl.GetProgramInfoLog(p, 1000, &length, &_log)
		log.Fatalf("Error: linking:\n%s\n", _log)
	}
	return p
}
예제 #2
0
파일: main.go 프로젝트: remogatto/videocore
func showProgramLog(shader uint32) {
	// Prints the information log for a program object
	var logString string
	gl.GetProgramInfoLog(shader, 1024, nil, &logString)
	log.Printf("%d:program:\n%s\n", shader, logString)
}