Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: glLoadName.. is there a limit

  1. #1
    Junior Member Regular Contributor
    Join Date
    Feb 2001
    Posts
    136

    glLoadName.. is there a limit

    Hi,

    Is there a limit on how many names can we push on the name stack using glLoadName in opengl (i am doing a selection problem here)

    thanx

  2. #2
    Senior Member OpenGL Pro
    Join Date
    May 2000
    Location
    Hannover, Germany
    Posts
    1,258

    Re: glLoadName.. is there a limit

    maybe glGetIntegerv( GL_MAX_NAME_STACK_DEPTH, ... ) ?
    - Michael Steinberg

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

    Re: glLoadName.. is there a limit

    glLoadName replaces the top-of-stack name. it does not increment or decrement the name stack position. glPushName and glPopName do.
    The maximum number of possible names is 2^32-1.

  4. #4
    Senior Member OpenGL Pro
    Join Date
    May 2000
    Location
    Hannover, Germany
    Posts
    1,258

    Re: glLoadName.. is there a limit

    So, the basic question should have been, how many names can we push onto the stack.
    - Michael Steinberg

  5. #5
    Junior Member Regular Contributor
    Join Date
    Feb 2001
    Posts
    136

    Re: glLoadName.. is there a limit

    Well i guess your right. The question should have been that.. anyway thanks for the help.

  6. #6
    Junior Member Regular Contributor
    Join Date
    Aug 2000
    Posts
    179

    Re: glLoadName.. is there a limit

    glLoadName replaces the top-of-stack name. it does not increment or decrement the name stack position. glPushName and glPopName do.
    The maximum number of possible names is 2^32-1.
    2^32 is the number of names that we can put in the stack ?

    Thank you for the moment
    Best regards
    KurtCob

  7. #7
    Junior Member Regular Contributor
    Join Date
    Jul 2000
    Location
    Nice, France
    Posts
    222

    Re: glLoadName.. is there a limit

    Try glGetIntegerv to retrieve the value of GL_MAX_NAME_STACK_DEPTH.

    If you look at the red book (State variables appendix), the minimum depth of the name stack is said to be 64 (it looks pretty much like 2^6 rather than 2^32).

    On Tom Nuydens' site, in the hardware section, http://www.gamedeveloper.org/delphi3...e/index.shtml, you can search for the name stack's depth for several chipsets, you'll find:
    Geforce2 GTS: 128
    Radeon: 128
    i.e. 2^7.

    I don't think you can push 4 billion names onto the stack.

  8. #8
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    3,115

    Re: glLoadName.. is there a limit

    Moz, the number of names you can place on the stack is the whole range of an integer (excluding zero, therefore 2^32-1). An integer is, in OpenGL at least, 32 bits long.

    64 as you mentioned, is the (minimum) number of names you can push into the stack.

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

    Re: glLoadName.. is there a limit

    >>The maximum number of possible names is 2^32-1.

    Yes, what I said is that the name is an 32 bit unsigned int. The name stack itself is implementation dependend and guaranteed not to be smaller than 64 entries.

    So if you really use glLoadName you can have as many as 2^32-1 different objects in the scene because the name stack pointer is never incremented or decremented.

    I actually have not yet seen a necessity to use glPushName and glPopName at all except for the bottom name stack element.

  10. #10
    Junior Member Regular Contributor
    Join Date
    Jul 2000
    Location
    Nice, France
    Posts
    222

    Re: glLoadName.. is there a limit

    Ok, I get your point now.

    But it seemed to me that the original question was about the stack's depth rather than about the number of possible names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •