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 specifying the bitwise-or of 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.
Parameters
mask: number
Specifies a mask that indicates which attributes to save. Values for mask are listed below.
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 specifying the bitwise-or of 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.