summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2015-03-08 21:55:27 -0400
committerDavid Thompson <dthompson2@worcester.edu>2015-03-08 21:56:20 -0400
commit7aa9d9e5dcd3dbb459343bb2372372d875cea95c (patch)
tree46aa145f530b24f896fc9bf767c647468c1b0e91
parent143094f0c9469455ce245377e8878c3b7ae3fe57 (diff)
render: mesh: Add null-mesh.
* sly/render/mesh.scm (null-mesh): New variable. * sly/render/context.scm (render-context-reset!): Reset to null-mesh.
-rw-r--r--sly/render/context.scm2
-rw-r--r--sly/render/mesh.scm2
2 files changed, 3 insertions, 1 deletions
diff --git a/sly/render/context.scm b/sly/render/context.scm
index 49547dc..0e96e26 100644
--- a/sly/render/context.scm
+++ b/sly/render/context.scm
@@ -79,7 +79,7 @@
(glUseProgram 0)
(%set-render-context-shader! context #f)
(glBindVertexArray 0)
- (%set-render-context-mesh! context #f))
+ (%set-render-context-mesh! context null-mesh))
(define-syntax-rule (with-render-context context body ...)
(begin (render-context-reset! context)
diff --git a/sly/render/mesh.scm b/sly/render/mesh.scm
index 9eea8ed..5f577ca 100644
--- a/sly/render/mesh.scm
+++ b/sly/render/mesh.scm
@@ -206,6 +206,8 @@
(vertex-buffer-id vbo)))
buffers))))))
+(define null-mesh (%make-mesh 0 0 '()))
+
(define (generate-vertex-array)
(let ((bv (u32vector 1)))
(glGenVertexArrays 1 (bytevector->pointer bv))