// PrintLog prints the error log for an object func PrintLog(object uint32) { var logLength int32 if gl.IsShader(object) { gl.GetShaderiv(object, gl.INFO_LOG_LENGTH, &logLength) } else if gl.IsProgram(object) { gl.GetProgramiv(object, gl.INFO_LOG_LENGTH, &logLength) } else { log.Fatal("PrintLog: not a shader or program") } infoLog := strings.Repeat("\x00", int(logLength+1)) if gl.IsShader(object) { gl.GetShaderInfoLog(object, logLength, nil, gl.Str(infoLog)) } else if gl.IsProgram(object) { gl.GetProgramInfoLog(object, logLength, nil, gl.Str(infoLog)) } log.Fatal(infoLog) }
func (c *Context) DeleteProgram(p Program) { _ = c.runOnContextThread(func() error { if !gl.IsProgram(uint32(p)) { return nil } gl.DeleteProgram(uint32(p)) return nil }) }
// IsProgram reports if p is a valid program object. // // http://www.khronos.org/opengles/sdk/docs/man3/html/glIsProgram.xhtml func IsProgram(p Program) bool { return gl.IsProgram(p.Value) }