Skip to content

Instantly share code, notes, and snippets.

@nixeagle
Created July 9, 2010 01:19
Show Gist options
  • Save nixeagle/468896 to your computer and use it in GitHub Desktop.
Save nixeagle/468896 to your computer and use it in GitHub Desktop.
(defmacro with-gl-array-values ((var type &optional components count) values
&body body)
;; Might want to make it so component types can nest:
;; (x y z (w v x)) or whatever
(let ((once-values (gensym "VALUES")))
`(let ((,once-values ,values))
,(let ((values once-values))
`(gl:with-gl-array (,var ,type :count (or ,count (length ,values)))
(setf (get-arrays ,var ,components) ,values)
;; Might want to have something that lets us bind stuff
;;automatically in teh arglists, but not a top priority.
;;(gl:bind-gl-vertex-array ,var)
,@body)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment