This topic is now archived and is closed to further replies.


Vertex arrays

Recommended Posts

Aargyle    122
I would like to use vertex arrays as openGL has native support for it, so they should be much faster. However in the OpenGl game programming book it says to switch between these arrays using gl*pointer(); but I can't find that one in the bluebook (* is not alphabetical? hehe). Can anyone outline the general procedure for setting up multiple vertex arrays and then switching between them to render? And is there any downside to using these things? Thanks much! edit: I mean the openGL vertex arrays that you have to enable with glEnableClientState(enum glarray), not my own generic vertex arrays. [edited by - aargyle on April 29, 2003 3:37:32 AM]

Share this post

Link to post
Share on other sites
mhays    122
here''s how i do it in part of my code...


glVertexPointer(3, GL_FLOAT, 0, Vertices[Frame % NumFrames]);
glColorPointer(3, GL_UNSIGNED_BYTE, 0, Colors[Frame % NumFrames]);

glDrawArrays(GL_TRIANGLES, 0, ArraySize/3);

"I have never let my schooling interfere with my education. " --- M.Twain
Marcus Hays

Share this post

Link to post
Share on other sites
Brian Jones    122
Also, heres a small program I made last week the does the basics of setting up vertex pointers.

I don''t have a signature

Share this post

Link to post
Share on other sites
Trienco    2555
and when you feel comfortable with vertex arrays and/or interleaved arrays you can have a look at either nvidia vertex array range extension or the rather new vertex buffer object extension (id prefer the later one.. its a little more work, but also more flexible, better supported and probably have a little better performance)...

those files might be horrible too look at but worth the time if you take it.

if i remember that right you could even have indices in such an object and store it in video memory (would be pretty neat for complex things)

Share this post

Link to post
Share on other sites