예제 #1
0
파일: program.go 프로젝트: PieterD/crap
func uniform(id uint32, index uint32, buf []byte) (name string, datatype uint32, size int32) {
	var length int32
	var isize int32
	var idatatype uint32
	gl.GetActiveUniform(id, index, int32(len(buf)), &length, &isize, &idatatype, &buf[0])
	return string(buf[:length : length+1]), idatatype, isize
}
예제 #2
0
파일: gl_opengl.go 프로젝트: tanema/amore
// GetActiveUniform returns details about an active uniform variable.
// A value of 0 for index selects the first active uniform variable.
// Permissible values for index range from 0 to the number of active
// uniform variables minus 1.
//
// http://www.khronos.org/opengles/sdk/docs/man3/html/glGetActiveUniform.xhtml
func GetActiveUniform(p Program, index uint32) (name string, size int, ty Enum) {
	var length, si int32
	var typ uint32
	name = strings.Repeat("\x00", 256)
	cname := gl.Str(name)
	gl.GetActiveUniform(p.Value, uint32(index), int32(len(name)-1), &length, &si, &typ, cname)
	name = name[:strings.IndexRune(name, 0)]
	return name, int(si), Enum(typ)
}