diff options
author | David Thompson <dthompson2@worcester.edu> | 2015-03-08 21:54:34 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2015-03-08 21:56:15 -0400 |
commit | 143094f0c9469455ce245377e8878c3b7ae3fe57 (patch) | |
tree | 3c3d6d30bef2d6228e9e7f2412cf3802817e5090 | |
parent | fecdf0878b9af3941f9dbdff0bae684fac74c9c2 (diff) |
render: texture: Add null-texture.
* sly/render/texture.scm (null-texture): New variable.
* sly/render/context.scm (render-context-reset!): Reset to null-texture.
-rw-r--r-- | sly/render/context.scm | 2 | ||||
-rw-r--r-- | sly/render/texture.scm | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/sly/render/context.scm b/sly/render/context.scm index dc89fad..49547dc 100644 --- a/sly/render/context.scm +++ b/sly/render/context.scm @@ -75,7 +75,7 @@ (gl-disable (enable-cap depth-test)) (%set-render-context-depth-test?! context #f) (glBindTexture (texture-target texture-2d) 0) - (%set-render-context-texture! context #f) + (%set-render-context-texture! context null-texture) (glUseProgram 0) (%set-render-context-shader! context #f) (glBindVertexArray 0) diff --git a/sly/render/texture.scm b/sly/render/texture.scm index 38a1800..0ebcd0c 100644 --- a/sly/render/texture.scm +++ b/sly/render/texture.scm @@ -47,6 +47,7 @@ texture-t1 texture-s2 texture-t2 + null-texture anchor-texture texture-vertex pack-texture-vertices @@ -72,6 +73,8 @@ (s2 texture-s2) (t2 texture-t2)) +(define null-texture (%make-texture 0 #f 0 0 0 0 0 0)) + (define (texture-region? texture) "Return #t if TEXTURE has a parent texture." (texture? (texture-parent texture))) |