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

Thread: glLoadName.. is there a limit

  1. #1
    Senior Member Regular Contributor
    Join Date
    Oct 2005
    Posts
    137

    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
    Dec 2007
    Posts
    1,077

    Re: glLoadName.. is there a limit

    maybe glGetIntegerv( GL_MAX_NAME_STACK_DEPTH, ... ) ?

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

    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
    Dec 2007
    Posts
    1,077

    Re: glLoadName.. is there a limit

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

  5. #5
    Senior Member Regular Contributor
    Join Date
    Oct 2005
    Posts
    137

    Re: glLoadName.. is there a limit

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

  6. #6
    Senior Member Regular Contributor
    Join Date
    Aug 2000
    Posts
    174

    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
    Senior Member Regular Contributor
    Join Date
    Jul 2000
    Location
    Nice, France
    Posts
    201

    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
    2,978

    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,450

    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
    Senior Member Regular Contributor
    Join Date
    Jul 2000
    Location
    Nice, France
    Posts
    201

    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.

Page 1 of 2 12 LastLast

Similar Threads

  1. glLoadName() - Help
    By BGwra in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-17-2010, 06:23 AM
  2. glPushName vs glLoadName
    By David Doria in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 11-08-2008, 12:35 PM
  3. hit record an glLoadName()
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-13-2005, 06:02 PM
  4. glLoadName trouble(again)
    By in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 04-05-2002, 08:04 AM
  5. glLoadName trouble
    By in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 04-04-2002, 08:11 AM

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