[cl-opengl-devel] Vertex Arrays

Charlie McMackin charliemac+cl-opengl at gmail.com
Mon Dec 18 02:39:10 UTC 2006


Hello,

To begin, as it's my first post, I'd like to thank all the developers
who started and maintain this project. As a hobbiest beginner, this
package allows me to play with the two things that I'm interested in
most these days, Lisp and OpenGL.

With that said, I was working my way through OpenGL Distilled by Paul
Martz, I noticed that section 2.8 on Vertex Arrays of the OpenGL spec
was missing. I wasn't quite sure if this was on purpose or not, in
favor of a more "Lispy" way but since I couldn't find any equivalent
functionality I decided it was a big TODO. So I've after researching
and playing with the system, I believe I've made a mostly function
patch to add Vertex Arrays to cl-opengl. Of course this has caveats.

The biggest caveat is I am still new to OpenGL and Lisp however my
patch does produce nearly accurate results of rb-varray in the
cl-glut-examples and I have hope that many of the other Vertex Array
functions that aren't tested in the rb-varray example work as well.
The "nearly accurate" results is why I've decided to mail in my patch.

For the there is something odd about how OpenGL is getting one vertex
and I can't for the life of me pinpoint it (hopefully due to my
green-thumbedness). I /think/ it's either with CFFI itself or the
'with-opengl-array' / 'with-opengl-sequence' macros or maybe even my
ATI mobitlity chip :(  I'd be interested to hear if rb-varray works
for anyone else. Sorry for the long explanation. Here's a short change
summary followed by the patch attachment generated by 'darcs whatsnew'

gl/package.lisp, funcs.lisp, opengl.lisp
   added the code for Vertex Arrays through CFFI and the export
symbols necessary

gl/util.lisp
    probably my more "dangerous" code as I modified slightly
with-opengl-sequence to get rid of the eval quick hack and modified
with-opengl-array to look like with-opengl-sequence with out the extra
gynsym for array. I hope I did it right and didn't shoot myself in the
foot...

examples/rb-varray.lisp
 adjusted until if gave me output using rb-cube.lisp as a reference

Thanks again and I hope this code is useful.

Charlie Mac
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cl-opengl-changes.patch
Type: text/x-patch
Size: 11090 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cl-opengl-devel/attachments/20061218/42894b97/attachment.bin>


More information about the cl-opengl-devel mailing list