diff options
author | David Thompson <dthompson2@worcester.edu> | 2014-04-21 22:20:52 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2014-04-21 22:20:52 -0400 |
commit | 491f4465e9c5fbc63ad92b8a6904d3e3c611ade1 (patch) | |
tree | 2427a3d43ffbb99e14e6d0d338e2ff644dc7069a /2d | |
parent | 744c702c45eb6115627f25d08b65aedd492fd806 (diff) |
Add shader-program-attribute-location procedure.
* 2d/shader.scm (shader-program-attribute-location): New procedure.
Diffstat (limited to '2d')
-rw-r--r-- | 2d/shader.scm | 6 |
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? |