summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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?