diff options
-rw-r--r-- | chickadee/graphics/buffer.scm | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/chickadee/graphics/buffer.scm b/chickadee/graphics/buffer.scm index fff1a88..f2fbfe0 100644 --- a/chickadee/graphics/buffer.scm +++ b/chickadee/graphics/buffer.scm @@ -790,23 +790,23 @@ argument may be overridden. The following values are supported: body ... (geometry-end* geometry type) ...)) +(define (begin:map buffer-pair) + (dynamic-buffer-map! (cdr buffer-pair))) + (define (geometry-begin! geometry) (let ((index-buffer (geometry-index-buffer geometry))) - (for-each (match-lambda - ((_ . buffer) - (dynamic-buffer-map! buffer))) - (geometry-vertex-buffers geometry)) + (for-each begin:map (geometry-vertex-buffers geometry)) (when index-buffer (dynamic-buffer-map! index-buffer)))) +(define (end:unmap buffer-pair) + (dynamic-buffer-unmap! (cdr buffer-pair))) + (define (geometry-end! geometry) (let ((index-buffer (geometry-index-buffer geometry))) (when index-buffer (dynamic-buffer-unmap! index-buffer)) - (for-each (match-lambda - ((_ . buffer) - (dynamic-buffer-unmap! buffer))) - (geometry-vertex-buffers geometry)))) + (for-each end:unmap (geometry-vertex-buffers geometry)))) (define-syntax-rule (with-geometry geometry body ...) (begin |