Ejemplo n.º 1
0
func GetAttachedShaders(
	program uint32, maxcount Sizei, count *Sizei, shaders *uint32) {
	C.glGetAttachedShaders(
		C.GLuint(program),
		C.GLsizei(maxcount),
		(*C.GLsizei)(count),
		(*C.GLuint)(shaders))
}
Ejemplo n.º 2
0
func (program Program) GetAttachedShaders() []Object {
	var len C.GLint
	C.glGetProgramiv(C.GLuint(program), C.GLenum(ACTIVE_UNIFORM_MAX_LENGTH), &len)

	objects := make([]Object, len)
	C.glGetAttachedShaders(C.GLuint(program), C.GLsizei(len), nil, *((**C.GLuint)(unsafe.Pointer(&objects))))
	return objects
}
Ejemplo n.º 3
0
func (program *Program) Shaders() []Shader {
	if !program.shadersValid {
		nshaders := C.GLint(0)
		C.glGetProgramiv(program.id, C.GL_ATTACHED_SHADERS, &nshaders)
		program.shaders = make([]Shader, nshaders)
		C.glGetAttachedShaders(program.id, C.GLsizei(nshaders), nil, (*C.GLuint)(&program.shaders[0]))
		program.shadersValid = true
	}
	return program.shaders
}
Ejemplo n.º 4
0
func GetAttachedShaders(p Program) []Shader {
	shadersLen := GetProgrami(p, ATTACHED_SHADERS)
	var n C.GLsizei
	buf := make([]C.GLuint, shadersLen)
	C.glGetAttachedShaders(p.c(), C.GLsizei(shadersLen), &n, &buf[0])
	buf = buf[:int(n)]
	shaders := make([]Shader, len(buf))
	for i, s := range buf {
		shaders[i] = Shader{Value: uint32(s)}
	}
	return shaders
}
Ejemplo n.º 5
0
func GetAttachedShaders(p Program) (r0 []Shader) {
	defer func() {
		errstr := errDrain()
		log.Printf("gl.GetAttachedShaders(%v) %v%v", p, r0, errstr)
	}()
	shadersLen := GetProgrami(p, ATTACHED_SHADERS)
	var n C.GLsizei
	buf := make([]C.GLuint, shadersLen)
	C.glGetAttachedShaders(p.c(), C.GLsizei(shadersLen), &n, &buf[0])
	buf = buf[:int(n)]
	shaders := make([]Shader, len(buf))
	for i, s := range buf {
		shaders[i] = Shader{Value: uint32(s)}
	}
	return shaders
}
Ejemplo n.º 6
0
func GetAttachedShaders(program int, shaders []uint32) []uint32 {
	C.glGetAttachedShaders(
		C.GLuint(program), C.GLsizei(cap(shaders)), nil, (*C.GLuint)(&shaders[0]))
	return shaders
}