P
glPushAttrib
Chapter 14
349
glPushAttrib
glPushAttrib, glPopAttrib: push and pop the server attribute stack.
C Specification
void glPushAttrib(
GLbitfield mask)
void glPopAttrib(void)
Parameters
mask Specifies a mask that indicates which attributes to save. Values for
mask are listed below.
Description
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):
GL_ACCUM_BUFFER_BIT Accumulation buffer clear value
GL_COLOR_BUFFER_BIT GL_ALPHA_TEST enable bit
Alpha test function and reference value
GL_BLEND enable bit
Blending source and destination functions
Constant blend color
Blending equation
GL_DITHER enable bit
GL_DRAW_BUFFER setting
GL_COLOR_LOGIC_OP enable bit
GL_INDEX_LOGIC_OP enable bit
Logic op function
Color mode and index mode clear values
Color mode and index mode writemasks