func CreateProgram() (r0 Program) { defer func() { errstr := errDrain() log.Printf("gl.CreateProgram() %v%v", r0, errstr) }() return Program{Value: uint32(C.glCreateProgram())} }
func createProgram(vertShaderSrc string, fragShaderSrc string) C.GLuint { vertShader := loadShader(C.GL_VERTEX_SHADER, vertShaderSrc) fragShader := loadShader(C.GL_FRAGMENT_SHADER, fragShaderSrc) prog := C.glCreateProgram() if prog == 0 { panic("Failed to create shader program") } C.glAttachShader(prog, vertShader) checkGLError() C.glAttachShader(prog, fragShader) checkGLError() C.glLinkProgram(prog) var linkStatus C.GLint C.glGetProgramiv(prog, C.GL_LINK_STATUS, &linkStatus) if linkStatus != C.GL_TRUE { log := GetProgramInfoLog(prog) panic(fmt.Errorf("Failed to link program: %v", log)) } return prog }
func CreateProgram() Program { return Program{Value: uint32(C.glCreateProgram())} }
func CreateProgram() uint32 { return uint32(C.glCreateProgram()) }
// NewProgram creates an empty program func NewProgram() *Program { return &Program{i: C.glCreateProgram()} }
func CreateProgram() Program { return Program{id: C.glCreateProgram()} }
// CreateProgram creates a program object. func CreateProgram() Program { return Program(C.glCreateProgram()) }
func CreateProgram() uint { return uint(C.glCreateProgram()) }