summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sly/render/mesh.scm9
1 files changed, 6 insertions, 3 deletions
diff --git a/sly/render/mesh.scm b/sly/render/mesh.scm
index 7a34ee5..fa57bb9 100644
--- a/sly/render/mesh.scm
+++ b/sly/render/mesh.scm
@@ -118,18 +118,21 @@
(arb-vertex-buffer-object element-array-buffer-arb)
(arb-vertex-buffer-object array-buffer-arb)))
-(define* (make-vertex-buffer vertices #:optional (index? #f))
+(define* (make-vertex-buffer vertices #:optional (index? #f) (stream? #f))
(let* ((bv (vertices-bytevector vertices index?))
(vbo (%make-vertex-buffer (generate-vertex-buffer)
(gl-buffer-type index?)
(attribute-size (vector-ref vertices 0))
(vector-length vertices)
- bv)))
+ bv))
+ (usage (if stream?
+ (arb-vertex-buffer-object static-draw-arb)
+ (arb-vertex-buffer-object stream-draw-arb))))
(with-vertex-buffer vbo
(glBufferData (vertex-buffer-type vbo)
(bytevector-length bv)
(bytevector->pointer bv)
- (arb-vertex-buffer-object static-draw-arb)))
+ usage))
vbo))
;;;