Results 1 to 8 of 8

Thread: Performance 2d/display lists

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2009
    Posts
    7

    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?

    Thanks

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jun 2009
    Location
    FL , USA
    Posts
    192

    Re: Performance 2d/display lists

    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.

  3. #3
    Senior Member Regular Contributor
    Join Date
    Jun 2009
    Location
    FL , USA
    Posts
    192

    Re: Performance 2d/display lists

    Not clear what is SDL.

  4. #4
    Senior Member OpenGL Pro Ilian Dinev's Avatar
    Join Date
    Jan 2008
    Location
    Watford, UK
    Posts
    1,294

    Re: Performance 2d/display lists

    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).

  5. #5
    Junior Member Newbie
    Join Date
    Jun 2009
    Posts
    7

    Re: Performance 2d/display lists

    Thanks for all the replies

    Quote Originally Posted by awhig
    Not clear what is SDL.
    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?

    Quote Originally Posted by Ilian Dinev
    For static stuff, display lists are the fastest[...]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).
    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

  6. #6
    Senior Member Regular Contributor
    Join Date
    Jun 2009
    Posts
    357

    Re: Performance 2d/display lists

    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.
    [The Open Toolkit library: C# OpenGL 4.4, OpenGL ES 3.1, OpenAL 1.1 for Mono/.Net]

  7. #7
    Junior Member Newbie
    Join Date
    Jun 2009
    Posts
    7

    Re: Performance 2d/display lists

    thanks

  8. #8
    Senior Member Frequent Contributor _NK47's Avatar
    Join Date
    Mar 2008
    Posts
    574

    Re: Performance 2d/display lists

    "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).

Similar Threads

  1. cg & display lists
    By nib in forum OpenGL: Advanced Coding
    Replies: 11
    Last Post: 11-04-2006, 07:22 PM
  2. Question about display lists and performance
    By 147-2 in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 02-22-2004, 10:11 PM
  3. Display Lists and DrawElements performance
    By guju in forum OpenGL: Advanced Coding
    Replies: 10
    Last Post: 06-24-2002, 07:02 AM
  4. Performance of Display Lists
    By guju in forum OpenGL: Advanced Coding
    Replies: 11
    Last Post: 06-13-2002, 06:15 PM
  5. display lists inside display lists...
    By architekt in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-22-2002, 08:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean