From 143094f0c9469455ce245377e8878c3b7ae3fe57 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 8 Mar 2015 21:54:34 -0400 Subject: render: texture: Add null-texture. * sly/render/texture.scm (null-texture): New variable. * sly/render/context.scm (render-context-reset!): Reset to null-texture. --- sly/render/context.scm | 2 +- sly/render/texture.scm | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) 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))) -- cgit v1.2.3