aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiriel <daneel_libre@yahoo.fr>2013-10-18 19:08:11 +0200
committerNiriel <daneel_libre@yahoo.fr>2013-10-18 19:08:11 +0200
commit149b0c0b5e101ae01217e2018754bacfbea4e42f (patch)
tree050f186612f180ca8eca35c1bc0bf186db4e92ac
parentb09fa4f235d954f60e71e0fb21869ca80e719d53 (diff)
downloadgl-149b0c0b5e101ae01217e2018754bacfbea4e42f.tar.gz
Added GetUniformBlockIndex and UniformBlockBinding.
-rw-r--r--program.go12
-rw-r--r--uniformblockindex.go7
2 files changed, 19 insertions, 0 deletions
diff --git a/program.go b/program.go
index 9fc7a3b..56944e8 100644
--- a/program.go
+++ b/program.go
@@ -128,6 +128,18 @@ func (program Program) GetUniformLocation(name string) UniformLocation {
return UniformLocation(C.glGetUniformLocation(C.GLuint(program), cname))
}
+func (program Program) GetUniformBlockIndex(name string) UniformBlockIndex {
+
+ cname := glString(name)
+ defer freeString(cname)
+
+ return UniformBlockIndex(C.glGetUniformBlockIndex(C.GLuint(program), cname))
+}
+
+func (program Program) UniformBlockBinding(index UniformBlockIndex, binding uint) {
+ C.glUniformBlockBinding(C.GLuint(program), C.GLuint(index), C.GLuint(binding))
+}
+
func (program Program) GetAttribLocation(name string) AttribLocation {
cname := glString(name)
diff --git a/uniformblockindex.go b/uniformblockindex.go
new file mode 100644
index 0000000..7855b3f
--- /dev/null
+++ b/uniformblockindex.go
@@ -0,0 +1,7 @@
+// Copyright 2012 The go-gl Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package gl
+
+type UniformBlockIndex uint