summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2021-05-08 10:39:40 -0400
committerDavid Thompson <dthompson2@worcester.edu>2021-05-08 10:40:23 -0400
commit1e392ac7e19058a0cf280c6602d44a5ae3243560 (patch)
tree8a3d88afbeae06596e4c736305007a54dd51d74d
parent72b23993fb6a9f582edcb8c475a8e372e338dcd5 (diff)
graphics: buffer: Fix rendering of vertex arrays without indices.
-rw-r--r--chickadee/graphics/buffer.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/chickadee/graphics/buffer.scm b/chickadee/graphics/buffer.scm
index 4b7b260..52c1293 100644
--- a/chickadee/graphics/buffer.scm
+++ b/chickadee/graphics/buffer.scm
@@ -601,7 +601,12 @@ argument may be overridden. The following values are supported:
(buffer-view-length indices))
(buffer-view-type-gl indices)
%null-pointer))
- (gl-draw-arrays (vertex-array-mode-gl array) offset count)))))
+ (gl-draw-arrays (vertex-array-mode-gl array)
+ offset
+ (or count
+ (buffer-view-length
+ (assv-ref (vertex-array-attributes array)
+ 0))))))))
(define* (render-vertices/instanced array instances #:key count (offset 0))
(with-graphics-state! ((g:vertex-array array))