示例#1
0
文件: gles2.go 项目: remogatto/egles
func GetAttachedShaders(
	program uint32, maxcount Sizei, count *Sizei, shaders *uint32) {
	C.glGetAttachedShaders(
		C.GLuint(program),
		C.GLsizei(maxcount),
		(*C.GLsizei)(count),
		(*C.GLuint)(shaders))
}
示例#2
0
文件: program.go 项目: kanelbulle/gl
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
}
示例#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
}
示例#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
}
示例#5
0
文件: gldebug.go 项目: Miaque/mojo
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
}
示例#6
0
文件: es2.go 项目: nick-fedesna/egles
func GetAttachedShaders(program int, shaders []uint32) []uint32 {
	C.glGetAttachedShaders(
		C.GLuint(program), C.GLsizei(cap(shaders)), nil, (*C.GLuint)(&shaders[0]))
	return shaders
}