summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2015-09-09 09:07:31 -0400
committerDavid Thompson <dthompson2@worcester.edu>2015-09-09 09:07:31 -0400
commit0bba6c1ce973be5c99057e880c550627146ec616 (patch)
treece5128740d54be29b99dc98f828f1b087a612594
parent5b8f43d7a5cad91e81e85b81f3fc41a80f84c647 (diff)
render: mesh: Add custom record type printer.
This avoids an issue where debugging output would be clogged by dumping *all* of the vertex information for large meshes. * sly/render/mesh.scm (<mesh>): Add record type printer that doesn't print out the vertices.
-rw-r--r--sly/render/mesh.scm9
1 files changed, 9 insertions, 0 deletions
diff --git a/sly/render/mesh.scm b/sly/render/mesh.scm
index 5f577ca..1a666e3 100644
--- a/sly/render/mesh.scm
+++ b/sly/render/mesh.scm
@@ -25,6 +25,7 @@
#:use-module (system foreign)
#:use-module (ice-9 match)
#:use-module (srfi srfi-9)
+ #:use-module (srfi srfi-9 gnu)
#:use-module (srfi srfi-43)
#:use-module (rnrs bytevectors)
#:use-module (gl)
@@ -56,6 +57,14 @@
(usage vertex-buffer-usage)
(data vertex-buffer-data))
+(set-record-type-printer! <vertex-buffer>
+ (lambda (vbo port)
+ (format port
+ "#<vertex-buffer id: ~d type: ~a usage: ~a"
+ (vertex-buffer-id vbo)
+ (vertex-buffer-type vbo)
+ (vertex-buffer-usage vbo))))
+
(define (generate-vertex-buffer)
(let ((bv (u32vector 1)))
(glGenBuffers 1 (bytevector->pointer bv))