PDA

View Full Version : Why my GL_NAME_STACK_DEPTH is initially 3440?



earth_walker
07-18-2003, 10:34 AM
Hi! I'm using OpenGL under Delphi 5.0.

I use the Watch window to monitor the value of GL_NAME_STACK_DEPTH and GL_MAX_NAME_STACK_DEPTH.
GL_MAX_NAME_STACK_DEPTH is always 3383, which is reasonable. However, GL_NAME_STACK_DEPTH is always 3440, which is not reasonalbe.
I checked its value at the points of right after executing glInitNames, glPushName, glLoadName and right after change to GL_RENDER from GL_SELECT state, but its value kept being 3440 without changing.

I check the documentation and it says that it should be initially 0.

Can you give me some idea?

Thank you!

Deiussum
07-18-2003, 10:53 AM
You put a watch on GL_NAME_STACK_DEPTH and GL_MAX_NAME_STACK_DEPTH, or you put a watch on the value returned by glGetInteger when you pass those in?

Those are constants that you use in glGetInteger, so if you put the watch directly on them, they will never change. They are not variables that will be dynamically changed as you push/pop the name stack.

earth_walker
07-18-2003, 11:00 AM
Hi! Thank you. Then I understand, these two values must be some kind of pointers or indexes that points to other memory blocks which store the integer values.

Deiussum
07-18-2003, 11:07 AM
Not exactly. They are just constants so that the OpenGL drivers know what you are trying to retrieve information about when you call a function like glGetInteger.

The same way that GL_PROJECTION and GL_MODELVIEW are constants so that OpenGL knows which matrix you mean when you call glMatrixMode. These constants are defined by the OpenGL specification. How the values they represent are actually stored is left up to the driver implementation.

Edit: Just took a brief look through the OpenGL specs, and I guess the Specs don't define the values, just the constant names. At least, I didn't see the values listed there anywhere. I do think that most OpenGL implementations do use the same values for the same constant names, though.

[This message has been edited by Deiussum (edited 07-18-2003).]