示例#1
0
文件: gldebug.go 项目: Miaque/mojo
func DeleteShader(s Shader) {
	defer func() {
		errstr := errDrain()
		log.Printf("gl.DeleteShader(%v) %v", s, errstr)
	}()
	C.glDeleteShader(s.c())
}
示例#2
0
文件: gl.go 项目: 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
}
示例#3
0
func DeleteShader(s Shader) {
	C.glDeleteShader(s.c())
}
示例#4
0
文件: gles2.go 项目: remogatto/egles
func DeleteShader(
	shader uint32) {
	C.glDeleteShader(
		C.GLuint(shader))

}
示例#5
0
文件: shader.go 项目: vivicai/gl
func (shader Shader) Delete() { C.glDeleteShader(C.GLuint(shader)) }