summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2018-09-06 09:33:19 -0400
committerDavid Thompson <dthompson2@worcester.edu>2018-09-06 09:33:19 -0400
commitb3f98892edacce79525523984cb72eba2473f9e6 (patch)
tree0d66ec229230e6cf43252365bf57ab2e45558b06
parent2f5c81df88025f1a68b1d981c355cfaf9d4c1fbd (diff)
render: buffer: Use correct data type for index buffer when rendering.
* chickadee/render/buffer.scm (render-vertices): Use the index buffer type rather than assuming it is always unsigned-int.
-rw-r--r--chickadee/render/buffer.scm12
1 files changed, 6 insertions, 6 deletions
diff --git a/chickadee/render/buffer.scm b/chickadee/render/buffer.scm
index 9635db6..48362f0 100644
--- a/chickadee/render/buffer.scm
+++ b/chickadee/render/buffer.scm
@@ -516,9 +516,9 @@ be specified for the buffer."
(define* (render-vertices array #:optional count)
(gpu-state-set! *vertex-array-state* array)
- (gl-draw-elements (vertex-array-mode-gl array)
- (or count
- (typed-buffer-length
- (vertex-array-indices array)))
- (data-type unsigned-int)
- %null-pointer))
+ (let ((indices (vertex-array-indices array)))
+ (gl-draw-elements (vertex-array-mode-gl array)
+ (or count
+ (typed-buffer-length indices))
+ (typed-buffer-type-gl indices)
+ %null-pointer)))