summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-08-16 22:04:06 -0400
committerDavid Thompson <dthompson2@worcester.edu>2014-08-25 19:33:07 -0400
commit2f27f5c49a61d0d891b2d2f045915a89365762ae (patch)
tree20361efc52f1d54657ca688d140cccab96e981f2
parentaeb6fafbcbc87b699b75193b28eda6a0eb1073b9 (diff)
Add load-default-shader procedure.
* sly/shader.scm (load-default-shader): New procedure.
-rw-r--r--sly/shader.scm15
1 files changed, 15 insertions, 0 deletions
diff --git a/sly/shader.scm b/sly/shader.scm
index 489b77c..d8c5be5 100644
--- a/sly/shader.scm
+++ b/sly/shader.scm
@@ -28,6 +28,7 @@
#:use-module (sly transform)
#:use-module (sly vector)
#:use-module (sly color)
+ #:use-module (sly config)
#:use-module (sly wrappers gl)
#:export (make-shader
make-vertex-shader
@@ -47,6 +48,7 @@
shader-program?
shader-program-linked?
with-shader-program
+ load-default-shader
%uniform-setters
register-uniform-setter!
uniforms))
@@ -232,6 +234,19 @@ VERTEX-SHADER and FRAGMENT-SHADER."
(glUseProgram 0)
return-value))))
+(define load-default-shader
+ (memoize
+ (lambda ()
+ (load-shader-program
+ (string-append %pkgdatadir
+ "/shaders/default-vertex.glsl")
+ (string-append %pkgdatadir
+ "/shaders/default-fragment.glsl")))))
+
+;;;
+;;; Uniforms
+;;;
+
(define-record-type <uniform-setter>
(make-uniform-setter predicate proc)
uniform-setter?