Created
July 9, 2010 01:19
-
-
Save nixeagle/468896 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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