summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chickadee/graphics/buffer.scm26
1 files changed, 15 insertions, 11 deletions
diff --git a/chickadee/graphics/buffer.scm b/chickadee/graphics/buffer.scm
index 8a30ea3..be78fc2 100644
--- a/chickadee/graphics/buffer.scm
+++ b/chickadee/graphics/buffer.scm
@@ -610,22 +610,26 @@ argument may be overridden. The following values are supported:
(set-gpu-vertex-array! (current-gpu) array)
(let ((indices (vertex-array-indices array)))
(if indices
- (gl-draw-elements (vertex-array-mode-gl array)
- (or count
- (buffer-view-length indices))
- (buffer-view-type-gl indices)
- %null-pointer)
+ (begin
+ (apply-buffer-view indices)
+ (gl-draw-elements (vertex-array-mode-gl array)
+ (or count
+ (buffer-view-length indices))
+ (buffer-view-type-gl indices)
+ %null-pointer))
(gl-draw-arrays (vertex-array-mode-gl array) offset count))))
(define* (render-vertices/instanced array instances #:key count (offset 0))
(set-gpu-vertex-array! (current-gpu) array)
(let ((indices (vertex-array-indices array)))
(when indices
- (gl-draw-elements-instanced (vertex-array-mode-gl array)
- (or count
- (buffer-view-length indices))
- (buffer-view-type-gl indices)
- %null-pointer
- instances)
+ (begin
+ (apply-buffer-view indices)
+ (gl-draw-elements-instanced (vertex-array-mode-gl array)
+ (or count
+ (buffer-view-length indices))
+ (buffer-view-type-gl indices)
+ %null-pointer
+ instances))
(gl-draw-arrays-instanced (vertex-array-mode-gl array)
offset count instances))))