diff options
author | David Thompson <dthompson2@worcester.edu> | 2014-08-16 22:04:06 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2014-08-25 19:33:07 -0400 |
commit | 2f27f5c49a61d0d891b2d2f045915a89365762ae (patch) | |
tree | 20361efc52f1d54657ca688d140cccab96e981f2 | |
parent | aeb6fafbcbc87b699b75193b28eda6a0eb1073b9 (diff) |
Add load-default-shader procedure.
* sly/shader.scm (load-default-shader): New procedure.
-rw-r--r-- | sly/shader.scm | 15 |
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? |