Performance 2d/display lists

Hi everyone

Do you guys know if it is faster to use glDrawElements, glMultiDrawElements, etc “inside” display lists, or the display lists are already optmized to be as fast as possible?
Another thing, and I am not sure if here is the right place to ask this but, which one is faster
to draw 2d graphics: plain SDL or SDL with openGL using ortho2d or something like that?


I guess, the combination of the two would give you best performance. A display list is recommended as it assures a fixed space in memory at compilation time. No re-compilation is required.

glDrawElements() is to save multiple calls for feeding in vertices for a complex primitive.

If compile time is taken to account then display lists should be faster, but at run time (for the same primitive and assuming a complex primitive with multiple calls in display list and the equivalent glDrawElement – vertex array ) , the latter should be fast.

Not clear what is SDL.

For static stuff, display lists are the fastest. Once you declare them with glDrawElements or whatever to be compiled-in, the memory arrays you specify are cloned, optimized, and uploaded to VRAM.

The thing is,… I’ve never seen 2D needing static stuff when textured rectangles need to be drawn for a scene (2D game or GUI).

Thanks for all the replies

It’s just a window manager. I will rephrase then: Opengl is not supposed to provide window management right? So if I am using window manager M and I want to use 2d graphics, should I use it with or without opengl for best performance?

I didn’t mean to mix my two questions. One is about display Lists and saving calls with glDrawElements, etc. The other one is about my window manager and opengl

OpenGL will give you significantly better performance than SDL’s software renderer. The difference becomes vast once you start using textures and blending.

For 2d graphics, everything built over the last 8 years will be more than fast enough - display lists or not. Display lists tend to be faster than plain VBOs on static stuff, but VBOs are more flexible. If you need the flexibility, or if you wish to keep forward-compatibility with OpenGL 3.0+ then stick with VBOs; if not, use whatever feels more natural to you.


“which one is faster
to draw 2d graphics: plain SDL or SDL with openGL using ortho2d or something like that”
to make it more clear, in this case the one is faster which is hardware accelerated. here OpenGL “can be” HW accelerated if you have proper drivers and no Mesa3D override.

if you decide to use display lists use them to combine renderstate changes (blending, depth, etc).