Example #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
}
Example #2
0
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)
}