func LoadProgram(program gl.Program, vertexShader gl.VertexShader, fragmentShader gl.FragmentShader) error { gl.AttachShader(program, gl.Uint(vertexShader)) gl.AttachShader(program, gl.Uint(fragmentShader)) gl.LinkProgram(program) var ok gl.Int gl.GetProgramiv(program, gl.LINK_STATUS, &ok) if ok == 0 { fmt.Fprintln(os.Stderr, gl.GetProgramInfoLog(program)) gl.DeleteProgram(program) return errors.New("Failed to link shader program") } return nil }
func (s *StencilOp) Unmask(level int) *StencilOp { gl.StencilFunc(gl.ALWAYS, gl.Int(level), ^gl.Uint(0)) return s }
func (s *StencilOp) Mask(level int) *StencilOp { gl.StencilFunc(gl.EQUAL, gl.Int(level), ^gl.Uint(0)) return s }
func LoadFragmentShaderSource(shader gl.FragmentShader, filename string) error { return LoadShader(gl.Uint(shader), filename) }
func LoadVertexShaderSource(shader gl.VertexShader, filename string) error { return LoadShader(gl.Uint(shader), filename) }