Sign in to follow this  
angry

OpenGL glVertexPointer and Display Lists

Recommended Posts

Ok, this is kinda weird. I've been making display lists, and in the display list I call glVertexPointer to set my vertex array and then I draw it using glDrawArrays. And then when I want to render i simple use one single call, glCallList(). And this works great! I get 30-40% FPS increase. However I was reading the reference under glVertexPointer, and it says I can't include it inside a display list. And this confuses me. Since I'm not manually calling glVertexPointer before everytime I call the list. So how is this possible? Or does the "new" graphics cards support this only my reference doesn't mention it? And I am calling several display lists every frame, so if this glVertexPointer wasn't supported, my program should crash, or at least draw the same geometry over and over again.. But it doesn't.. Err.. can someone enlighten me? edit: Found a lot more places saying I can't put glVertexPointer in a display list, here's one for example: http://www.lighthouse3d.com/opengl/displaylists/index.php3?4 [Edited by - angry on October 21, 2006 1:41:03 AM]

Share this post


Link to post
Share on other sites
When in doubt check the spec.

Quote:

Certain commands are not compiled into the display list but
are executed immediately, regardless of the display-list
mode.
These commands are glColorPointer, glDeleteLists,
glDisableClientState, glEdgeFlagPointer,
glEnableClientState, glFeedbackBuffer, glFinish, glFlush,
glGenLists, glIndexPointer, glInterleavedArrays,
glIsEnabled, glIsList, glNormalPointer, glPopClientAttrib,
glPixelStore, glPushClientAttrib, glReadPixels,
glRenderMode, glSelectBuffer, glTexCoordPointer,
glVertexPointer, and all of the glGet commands.


It seems like it shouldn't work so I would advise against using it because it most likely doesn't work on all hardware and all drivers.

Why are you putting glVertexPointer calls in display lists anyway?

What graphics card are you running btw?

Share this post


Link to post
Share on other sites
I'm running an ATI Xpress 200 series graphics card, an onboard type thingy...

Anyways I think i've figured it out.. it's just a missinterpretation. It doesn't store the actual glVertexPointer call, but it does store the geometry passed by the glDrawArrays call, so you really just have to call glVertexPointer once when dealing with display lists.
And since the geometry is stored you can do whatever you want with the pointer after that, you can delete it or whatever.

In other words, no need to pass the pointer every time since the geometry is already stored on the graphics card and is no longer in your system memory!

So I think I'm safe :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this