func DeleteShader(s Shader) { defer func() { errstr := errDrain() log.Printf("gl.DeleteShader(%v) %v", s, errstr) }() C.glDeleteShader(s.c()) }
// NewShader creates a shader object of type typ, loads it with source code src and compiles it func NewShader(typ int, src string) (Shader, error) { var val C.GLint shad := C.glCreateShader(C.GLenum(typ)) s := (*C.GLchar)(C.CString(src)) C.glShaderSource(shad, 1, &s, nil) C.glCompileShader(shad) C.glGetShaderiv(shad, COMPILE_STATUS, &val) if val != TRUE { C.glGetShaderiv(shad, INFO_LOG_LENGTH, &val) buf := make([]C.GLchar, val+1) C.glGetShaderInfoLog(shad, C.GLsizei(val), nil, &buf[0]) C.glDeleteShader(shad) return Shader(0), errors.New(C.GoString((*C.char)(&buf[0]))) } return Shader(shad), nil }
func DeleteShader(s Shader) { C.glDeleteShader(s.c()) }
func DeleteShader( shader uint32) { C.glDeleteShader( C.GLuint(shader)) }
func (shader Shader) Delete() { C.glDeleteShader(C.GLuint(shader)) }