From 3d59d97515a8d73d8c4ea5ff6aeb8fb617ca7cda Mon Sep 17 00:00:00 2001 From: David Thompson Date: Thu, 9 May 2019 16:27:18 -0400 Subject: render: buffer: Add buffer-mapped? procedure. * chickadee/render/buffer.scm (buffer-mapped?): New procedure. --- chickadee/render/buffer.scm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chickadee/render/buffer.scm b/chickadee/render/buffer.scm index 702423b..5285be3 100644 --- a/chickadee/render/buffer.scm +++ b/chickadee/render/buffer.scm @@ -39,6 +39,7 @@ make-streaming-buffer buffer? index-buffer? + buffer-mapped? buffer-name buffer-length buffer-stride @@ -197,6 +198,10 @@ never sent to the GPU." for streaming data to the GPU every frame." (make-buffer #f #:usage 'stream #:length length #:name name #:target target)) +(define (buffer-mapped? buffer) + "Return #t if buffer data has been mapped from GPU." + (if (buffer-data buffer) #t #f)) + (define (map-buffer! buffer) "Map the memory space for BUFFER from the GPU to the CPU, allowing the vertex buffer to be updated with new vertex data. The -- cgit v1.2.3