Jump to content
  • Advertisement
Sign in to follow this  

OpenGL glVertexPointer and Display Lists

This topic is 4293 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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.


Certain commands are not compiled into the display list but
are executed immediately, regardless of the display-list
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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!