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 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: glLoadName.. is there a limit

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

    Re: glLoadName.. is there a limit

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

    Right, and the first answer from Michael gave already the right clue. Nevertheless, you won't hit the maximum stack depth using glLoadName ever.

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

    Re: glLoadName.. is there a limit

    Thanks for all the help. It seems when we do a glLoadName we simply replace the top of the stack , which means we just lost the entry for last object... so if we do 1 glPushName and 10 glLoadName we will effetively have 1 entry on the stack...? so that means we will get the same name for every selection hit that will occur...???

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

    Re: glLoadName.. is there a limit

    Pseudo algorithm:
    1.) You call glLoadName before you draw the object.
    2.) Draw the object. If the object would set pixels in the current view, you get the top of name stack element in the selection buffer.
    3.) Goto 1. while not all named objects have been drawn.

    That means the selection buffer grows which each hit and you always can check which object triggered that. No need for glPushName and glPopName as long as you don't have hierarchical selection requirements.

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

    Re: glLoadName.. is there a limit

    Ok...now iget it... thanx a lot

Posting Permissions

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