diff options
author | David Thompson <dthompson2@worcester.edu> | 2014-03-29 16:16:33 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2014-03-29 16:16:33 -0400 |
commit | 40bacd7e2ba29a1813a8fcd8070cf9ea4a9abca8 (patch) | |
tree | 357871d81758a8f878b303c5c814a38be79bad8a /2d | |
parent | 2fd537d6ecaa428068ad0576cafcd1254e5e654f (diff) |
Don't load sprite shaders upon importing (2d sprite) module.
* 2d/sprite.scm (sprite-shader): Set to #f initially.
(enable-sprites): New procedure.
* 2d/common.scm: Enable sprites.
Diffstat (limited to '2d')
-rw-r--r-- | 2d/sprite.scm | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/2d/sprite.scm b/2d/sprite.scm index 7c7b9c0..3b74fdb 100644 --- a/2d/sprite.scm +++ b/2d/sprite.scm @@ -41,7 +41,8 @@ #:use-module (2d vector2) #:use-module (2d window) #:use-module (2d wrappers gl) - #:export (make-sprite + #:export (enable-sprites + make-sprite sprite? animated-sprite? sprite-drawable @@ -63,12 +64,17 @@ ;;; Sprites ;;; -(define sprite-shader - (make-shader-program - (load-vertex-shader (string-append %pkgdatadir - "/shaders/sprite-vertex.glsl")) - (load-fragment-shader (string-append %pkgdatadir - "/shaders/sprite-fragment.glsl")))) +(define sprite-shader #f) + +(define (enable-sprites) + (set! sprite-shader + (make-shader-program + (load-vertex-shader + (string-append %pkgdatadir + "/shaders/sprite-vertex.glsl")) + (load-fragment-shader + (string-append %pkgdatadir + "/shaders/sprite-fragment.glsl"))))) ;; The <sprite> type represents a drawable object (texture, ;; texture-region, animation, etc.) with a given position, scale, |