Skip to content
Permalink
Browse files

Allow specifying vertex-form explicitly on translating mesh

  • Loading branch information...
Shinmera committed Aug 30, 2019
1 parent 415abd1 commit 37334a163d2ae62c0dbf27951a5557ffb034519e
Showing with 7 additions and 5 deletions.
  1. +7 −5 geometry.lisp
@@ -209,11 +209,13 @@
(replace-vertex-data (make-array 0 :adjustable T :element-type 'single-float)
mesh :attributes attributes))

(defmethod update-instance-for-different-class ((mesh vertex-mesh) (array vertex-array) &key (data-usage :static-draw) (vertex-attributes T))
(setf (vertex-form array) (ecase (face-length mesh)
(1 :points)
(2 :lines)
(3 :triangles)))
(defmethod update-instance-for-different-class ((mesh vertex-mesh) (array vertex-array) &key (data-usage :static-draw) (vertex-attributes T) vertex-form)
(setf (vertex-form array)
(or vertex-form
(ecase (face-length mesh)
(1 :points)
(2 :lines)
(3 :triangles))))
(if (< 0 (length (vertices mesh)))
(let* ((primer (aref (vertices mesh) 0))
(attributes (etypecase vertex-attributes

0 comments on commit 37334a1

Please sign in to comment.
You can’t perform that action at this time.