Example #1
0
func glGetLocation(glProg gl.Uint, name string, isAtt bool) gl.Uint {
	var a gl.Int
	var s = gl.GLString(name)
	defer gl.GLStringFree(s)
	if isAtt {
		a = gl.GetAttribLocation(glProg, s)
	} else {
		a = gl.GetUniformLocation(glProg, s)
	}
	if a < 0 {
		panic("Shader attribute or uniform bind error")
	}
	return gl.Uint(a)
}
Example #2
0
func ShaderLocationA(glProg gl.Uint, name string) gl.Uint {
	return gl.Uint(ShaderLocation(glProg, name, true))
}