summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--2d/shader.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/2d/shader.scm b/2d/shader.scm
index c34f48b..094b929 100644
--- a/2d/shader.scm
+++ b/2d/shader.scm
@@ -28,6 +28,7 @@
#:use-module (2d transform)
#:use-module (2d vector2)
#:use-module (2d color)
+ #:use-module (2d wrappers gl)
#:export (make-shader
make-vertex-shader
make-fragment-shader
@@ -42,6 +43,7 @@
shader-program-id
shader-program?
shader-program-linked?
+ shader-program-attribute-location
with-shader-program
%uniform-setters
register-uniform-setter!
@@ -211,6 +213,10 @@ SHADERS."
(glUseProgram 0)
return-value))))
+(define (shader-program-attribute-location program name)
+ "Get the location of the attribute NAME within the shader PROGRAM."
+ (glGetAttribLocation (shader-program-id program) name))
+
(define-record-type <uniform-setter>
(make-uniform-setter predicate proc)
uniform-setter?