summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2018-01-28 10:31:32 -0500
committerDavid Thompson <dthompson2@worcester.edu>2018-01-29 18:56:01 -0500
commit4649420f53b50a0feb89960e9dbb864364b7aaaf (patch)
tree480c36c3b3472c8a3ac71881b166dfabc3c696c4
parent4f5cd3c255273f67f0a5eaead2d46c0913a9f7b8 (diff)
render: texture: Define custom record type printer for texture atlas.
* chickadee/render/texture.scm (display-texture): New procedure.
-rw-r--r--chickadee/render/texture.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/chickadee/render/texture.scm b/chickadee/render/texture.scm
index ba7233a..960b7d0 100644
--- a/chickadee/render/texture.scm
+++ b/chickadee/render/texture.scm
@@ -269,6 +269,14 @@ magnification. Valid values are 'nearest and 'linear. By default,
(texture texture-atlas-texture)
(vector texture-atlas-vector))
+(define (display-texture-atlas atlas port)
+ (format port
+ "#<texture-atlas texture: ~a size: ~d>"
+ (texture-atlas-texture atlas)
+ (vector-length (texture-atlas-vector atlas))))
+
+(set-record-type-printer! <texture-atlas> display-texture-atlas)
+
(define (list->texture-atlas texture rects)
"Return a new atlas for TEXTURE containing RECTS, a list of texture
coordinate rects denoting the various tiles within."