Results 1 to 7 of 7

Thread: How many display lists can I create?

  1. #1
    Senior Member Regular Contributor
    Join Date
    Jan 2005
    Location
    Stockholm, Sweden
    Posts
    164

    How many display lists can I create?

    My question is rather simple. I simply wonder if there is a way of querying the OpenGL context how many display lists I can create. I would like to do this in advance, instead of creating display lists until glGenLists(...) returns zero. Is there a way to do this?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: How many display lists can I create?

    There is no limit other than the amount of resources available to store the display lists.

  3. #3
    Senior Member Regular Contributor
    Join Date
    Jan 2005
    Location
    Stockholm, Sweden
    Posts
    164

    Re: How many display lists can I create?

    I assume there is a limit as the number of lists approaches the integer value representable by a GLuint, alhtough this is an astronimically large numer and not a limitation for me.

    What exactly is the amount of resources you are referring to?

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: How many display lists can I create?

    The maximum number representable by a GLuint, as youy said, is one resource that sets a limit. At least 4.2 billion lists. Other resources are available memory.

  5. #5
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,450

    Re: How many display lists can I create?

    Because on 32-bit OSes virtual address space runs out before you can even generate so many display lists IDs, the upper limit is just theoretical there.
    If you're building huge amounts of display lists it's important that you monitor the successful build. You need to put a glGetError after each glEndList to catch out-of-memory errors!
    If that happened, you need to free some memory or could fallback to vertex arrays or worse, immediate mode. Performance might be gone anyway under those low memory conditions.
    64-bit OSes rule.

  6. #6
    Senior Member Regular Contributor
    Join Date
    Jan 2005
    Location
    Stockholm, Sweden
    Posts
    164

    Re: How many display lists can I create?

    Not sure I follow you on the virtual address space but I guess it's more of a C++ topic than an OpenGL topic. Although it seems proven that this restriction actually applies to OpenGL programming (when using C++ of course).

    What I don't follow is how glGetError could catch an error that has to do with virtual address space. As you say the virtual address space is managed by the OS so it doesn't make sense to me at this stage.

    I would love an explanation on this one!

    Thanks for the quick replies!

  7. #7
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,450

    Re: How many display lists can I create?

    With 32 bit addresses you can only have a max of 4GB adressable (per process).
    GLuint is the type for display list IDs and 32 bit as well. Generating the 4G * 4 bytes IDs alone will not fit into your address space.

    Under Windows 32-bit system the adress space is normally divided between user and kernel space at 2GB each. You can set a boot option which changes that to 3GB user and 1GB kernel space, but that's it and your app needs to be aware of these large user adresses.
    Applications allocating huge amounts of data hit this 3GB limit already (thinking about a CAD app rendering a power plant or special effects SW for movie rendering with hundreds or thousands of animated people. Think about the extras in Matrix or Lord of the Rings.). There will always be a bigger scene not fitting into the 32-bit space. These applications likely use 64-bit OSes already.
    A display list build will fail in your process if you exhausted the memory in that way and the only option in the OpenGL implementation is to fail the display list compilation and return GL_OUT_OF_MEMORY. And your only option is to catch that with glGetError and handle the failure in your application.

Similar Threads

  1. create display lists in another thread
    By jyoung77 in forum OpenGL: Advanced Coding
    Replies: 11
    Last Post: 06-28-2009, 12:39 PM
  2. Display Lists
    By Rodrix in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 12-14-2006, 04:19 PM
  3. Display Lists and VAR
    By azcoder in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 12-26-2002, 05:27 AM
  4. Display Lists
    By 1000_Monkeys_Typing in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 10-29-2002, 02:59 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