コード例 #1
0
ファイル: crudevrc.go プロジェクト: hyl87/2011_Go_Geo_Gfx
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)
}
コード例 #2
0
ファイル: glutil.go プロジェクト: hyl87/2011_Go_Geo_Gfx
func ShaderLocationA(glProg gl.Uint, name string) gl.Uint {
	return gl.Uint(ShaderLocation(glProg, name, true))
}