Example #1
0
func DeleteShader(s Shader) {
	defer func() {
		errstr := errDrain()
		log.Printf("gl.DeleteShader(%v) %v", s, errstr)
	}()
	C.glDeleteShader(s.c())
}
Example #2
0
File: gl.go Project: extrame/gl
// 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
}
Example #3
0
func DeleteShader(s Shader) {
	C.glDeleteShader(s.c())
}
Example #4
0
func DeleteShader(
	shader uint32) {
	C.glDeleteShader(
		C.GLuint(shader))

}
Example #5
0
File: shader.go Project: vivicai/gl
func (shader Shader) Delete() { C.glDeleteShader(C.GLuint(shader)) }