GNU/Linux |
CentOS 5.3 |
|
![]() |
glPopAttrib(3gl) |
![]() |
glPushAttrib, glPopAttrib − push and pop the server attribute stack
void glPushAttrib( GLbitfield mask )
mask |
Specifies a mask that indicates which attributes to save. Values for mask are listed below. |
void glPopAttrib( void )
glPushAttrib takes one argument, a mask that indicates which groups of state variables to save on the attribute stack. Symbolic constants are used to set bits in the mask. mask is typically constructed by ORing several of these constants together. The special mask GL_ALL_ATTRIB_BITS can be used to save all stackable states.
The symbolic mask constants and their associated GL state are as follows (the second column lists which attributes are saved):
glPopAttrib
restores the values of the state variables saved with the
last
glPushAttrib command. Those not saved are left
unchanged.
It is an error to push attributes onto a full stack, or to pop attributes off an empty stack. In either case, the error flag is set and no other change is made to GL state.
Initially, the attribute stack is empty.
Not all values for GL state can be saved on the attribute stack. For example, render mode state, and select and feedback state cannot be saved. Client state must be saved with glPushClientAttrib.
The depth of the attribute stack depends on the implementation, but it must be at least 16.
When the GL_ARB_multitexture extension is supported, pushing and popping texture state apples to all supported texture units.
GL_STACK_OVERFLOW is generated if glPushAttrib is called while the attribute stack is full.
GL_STACK_UNDERFLOW is generated if glPopAttrib is called while the attribute stack is empty.
GL_INVALID_OPERATION is generated if glPushAttrib or glPopAttrib is executed between the execution of glBegin and the corresponding execution of glEnd.
glGet
with argument GL_ATTRIB_STACK_DEPTH
glGet with argument GL_MAX_ATTRIB_STACK_DEPTH
glGet(3G),
glGetClipPlane(3G), glGetError(3G),
glGetLight(3G), glGetMap(3G),
glGetMaterial(3G),
glGetPixelMap(3G), glGetPolygonStipple(3G),
glGetString(3G), glGetTexEnv(3G),
glGetTexGen(3G), glGetTexImage(3G),
glGetTexLevelParameter(3G),
glGetTexParameter(3G), glIsEnabled(3G),
glPushClientAttrib(3G)
![]() |
glPopAttrib(3gl) | ![]() |