📄 pushattrib.html
字号:
<HTML>
<BODY>
<PRE>
<STRONG>NAME</STRONG>
<STRONG>glPushAttrib,</STRONG> <STRONG>glPopAttrib</STRONG> - push and pop the server
attribute stack
<STRONG>C</STRONG> <STRONG>SPECIFICATION</STRONG>
void <STRONG>glPushAttrib</STRONG>( GLbitfield <EM>mask</EM> )
<STRONG>PARAMETERS</STRONG>
<EM>mask</EM> Specifies a mask that indicates which attributes to
save. Values for <EM>mask</EM> are listed below.
<STRONG>C</STRONG> <STRONG>SPECIFICATION</STRONG>
void <STRONG>glPopAttrib</STRONG>( void )
<STRONG>DESCRIPTION</STRONG>
<STRONG>glPushAttrib</STRONG> 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. <EM>mask</EM>
is typically constructed by ORing several of these constants
together. The special mask <STRONG>GL_ALL_ATTRIB_BITS</STRONG> 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):
<STRONG>GL_ACCUM_BUFFER_BIT</STRONG> Accumulation buffer clear value
<STRONG>GL_COLOR_BUFFER_BIT</STRONG> <STRONG>GL_ALPHA_TEST</STRONG> enable bit
Alpha test function and reference value
<STRONG>GL_BLEND</STRONG> enable bit
Blending source and destination functions
Constant blend color
Blending equation
<STRONG>GL_DITHER</STRONG> enable bit
<STRONG>GL_DRAW_BUFFER</STRONG> setting
<STRONG>GL_COLOR_LOGIC_OP</STRONG> enable bit
<STRONG>GL_INDEX_LOGIC_OP</STRONG> enable bit
Logic op function
Color mode and index mode clear values
Color mode and index mode writemasks
<STRONG>GL_CURRENT_BIT</STRONG> Current RGBA color
Current color index
Current normal vector
Current texture coordinates
Current raster position
<STRONG>GL_CURRENT_RASTER_POSITION_VALID</STRONG> flag
RGBA color associated with current raster position
Color index associated with current raster position
Texture coordinates associated with current raster position
<STRONG>GL_EDGE_FLAG</STRONG> flag
<STRONG>GL_DEPTH_BUFFER_BIT</STRONG> <STRONG>GL_DEPTH_TEST</STRONG> enable bit
Depth buffer test function
Depth buffer clear value
<STRONG>GL_DEPTH_WRITEMASK</STRONG> enable bit
<STRONG>GL_ENABLE_BIT</STRONG> <STRONG>GL_ALPHA_TEST</STRONG> flag
<STRONG>GL_AUTO_NORMAL</STRONG> flag
<STRONG>GL_BLEND</STRONG> flag
Enable bits for the user-definable clipping planes
<STRONG>GL_COLOR_MATERIAL</STRONG>
<STRONG>GL_CULL_FACE</STRONG> flag
<STRONG>GL_DEPTH_TEST</STRONG> flag
<STRONG>GL_DITHER</STRONG> flag
<STRONG>GL_FOG</STRONG> flag
<STRONG>GL_LIGHT</STRONG><EM>i</EM> where 0 <= <EM>i</EM><<STRONG>GL_MAX_LIGHTS</STRONG>
<STRONG>GL_LIGHTING</STRONG> flag
<STRONG>GL_LINE_SMOOTH</STRONG> flag
<STRONG>GL_LINE_STIPPLE</STRONG> flag
<STRONG>GL_COLOR_LOGIC_OP</STRONG> flag
<STRONG>GL_INDEX_LOGIC_OP</STRONG> flag
<STRONG>GL_MAP1_</STRONG><EM>x</EM> where <EM>x</EM> is a map type
<STRONG>GL_MAP2_</STRONG><EM>x</EM> where <EM>x</EM> is a map type
<STRONG>GL_NORMALIZE</STRONG> flag
<STRONG>GL_POINT_SMOOTH</STRONG> flag
<STRONG>GL_POLYGON_OFFSET_LINE</STRONG> flag
<STRONG>GL_POLYGON_OFFSET_FILL</STRONG> flag
<STRONG>GL_POLYGON_OFFSET_POINT</STRONG> flag
<STRONG>GL_POLYGON_SMOOTH</STRONG> flag
<STRONG>GL_POLYGON_STIPPLE</STRONG> flag
<STRONG>GL_SCISSOR_TEST</STRONG> flag
<STRONG>GL_STENCIL_TEST</STRONG> flag
<STRONG>GL_TEXTURE_1D</STRONG> flag
<STRONG>GL_TEXTURE_2D</STRONG> flag
Flags <STRONG>GL_TEXTURE_GEN_</STRONG><EM>x</EM> where <EM>x</EM> is S, T, R, or Q
<STRONG>GL_EVAL_BIT</STRONG> <STRONG>GL_MAP1_</STRONG><EM>x</EM> enable bits, where <EM>x</EM> is a map type
<STRONG>GL_MAP2_</STRONG><EM>x</EM> enable bits, where <EM>x</EM> is a map type
1D grid endpoints and divisions
2D grid endpoints and divisions
<STRONG>GL_AUTO_NORMAL</STRONG> enable bit
<STRONG>GL_FOG_BIT</STRONG> <STRONG>GL_FOG</STRONG> enable bit
Fog color
Fog density
Linear fog start
Linear fog end
Fog index
<STRONG>GL_FOG_MODE</STRONG> value
<STRONG>GL_HINT_BIT</STRONG> <STRONG>GL_PERSPECTIVE_CORRECTION_HINT</STRONG> setting
<STRONG>GL_POINT_SMOOTH_HINT</STRONG> setting
<STRONG>GL_LINE_SMOOTH_HINT</STRONG> setting
<STRONG>GL_POLYGON_SMOOTH_HINT</STRONG> setting
<STRONG>GL_FOG_HINT</STRONG> setting
<STRONG>GL_LIGHTING_BIT</STRONG> <STRONG>GL_COLOR_MATERIAL</STRONG> enable bit
<STRONG>GL_COLOR_MATERIAL_FACE</STRONG> value
Color material parameters that are tracking the current color
Ambient scene color
<STRONG>GL_LIGHT_MODEL_LOCAL_VIEWER</STRONG> value
<STRONG>GL_LIGHT_MODEL_TWO_SIDE</STRONG> setting
<STRONG>GL_LIGHTING</STRONG> enable bit
Enable bit for each light
Ambient, diffuse, and specular intensity for each light
Direction, position, exponent, and cutoff angle for each light
Constant, linear, and quadratic attenuation factors for each light
Ambient, diffuse, specular, and emissive color for each material
Ambient, diffuse, and specular color indices for each material
Specular exponent for each material
<STRONG>GL_SHADE_MODEL</STRONG> setting
<STRONG>GL_LINE_BIT</STRONG> <STRONG>GL_LINE_SMOOTH</STRONG> flag
<STRONG>GL_LINE_STIPPLE</STRONG> enable bit
Line stipple pattern and repeat counter
Line width
<STRONG>GL_LIST_BIT</STRONG> <STRONG>GL_LIST_BASE</STRONG> setting
<STRONG>GL_PIXEL_MODE_BIT</STRONG> <STRONG>GL_RED_BIAS</STRONG> and <STRONG>GL_RED_SCALE</STRONG> settings
<STRONG>GL_GREEN_BIAS</STRONG> and <STRONG>GL_GREEN_SCALE</STRONG> values
<STRONG>GL_BLUE_BIAS</STRONG> and <STRONG>GL_BLUE_SCALE</STRONG>
<STRONG>GL_ALPHA_BIAS</STRONG> and <STRONG>GL_ALPHA_SCALE</STRONG>
<STRONG>GL_DEPTH_BIAS</STRONG> and <STRONG>GL_DEPTH_SCALE</STRONG>
<STRONG>GL_INDEX_OFFSET</STRONG> and <STRONG>GL_INDEX_SHIFT</STRONG> values
<STRONG>GL_MAP_COLOR</STRONG> and <STRONG>GL_MAP_STENCIL</STRONG> flags
<STRONG>GL_ZOOM_X</STRONG> and <STRONG>GL_ZOOM_Y</STRONG> factors
<STRONG>GL_READ_BUFFER</STRONG> setting
<STRONG>GL_POINT_BIT</STRONG> <STRONG>GL_POINT_SMOOTH</STRONG> flag
Point size
<STRONG>GL_POLYGON_BIT</STRONG> <STRONG>GL_CULL_FACE</STRONG> enable bit
<STRONG>GL_CULL_FACE_MODE</STRONG> value
<STRONG>GL_FRONT_FACE</STRONG> indicator
<STRONG>GL_POLYGON_MODE</STRONG> setting
<STRONG>GL_POLYGON_SMOOTH</STRONG> flag
<STRONG>GL_POLYGON_STIPPLE</STRONG> enable bit
<STRONG>GL_POLYGON_OFFSET_FILL</STRONG> flag
<STRONG>GL_POLYGON_OFFSET_LINE</STRONG> flag
<STRONG>GL_POLYGON_OFFSET_POINT</STRONG> flag
<STRONG>GL_POLYGON_OFFSET_FACTOR</STRONG>
<STRONG>GL_POLYGON_OFFSET_UNITS</STRONG>
<STRONG>GL_POLYGON_STIPPLE_BIT</STRONG> Polygon stipple image
<STRONG>GL_SCISSOR_BIT</STRONG> <STRONG>GL_SCISSOR_TEST</STRONG> flag
Scissor box
<STRONG>GL_STENCIL_BUFFER_BIT</STRONG> <STRONG>GL_STENCIL_TEST</STRONG> enable bit
Stencil function and reference value
Stencil value mask
Stencil fail, pass, and depth buffer pass actions
Stencil buffer clear value
Stencil buffer writemask
<STRONG>GL_TEXTURE_BIT</STRONG> Enable bits for the four texture coordinates
Border color for each texture image
Minification function for each texture image
Magnification function for each texture image
Texture coordinates and wrap mode for each texture image
Color and mode for each texture environment
Enable bits <STRONG>GL_TEXTURE_GEN_</STRONG><EM>x</EM>, <EM>x</EM> is S, T, R, and Q
<STRONG>GL_TEXTURE_GEN_MODE</STRONG> setting for S, T, R, and Q
<STRONG>glTexGen</STRONG> plane equations for S, T, R, and Q
Current texture bindings (for example, <STRONG>GL_TEXTURE_2D_BINDING</STRONG>)
<STRONG>GL_TRANSFORM_BIT</STRONG> Coefficients of the six clipping planes
Enable bits for the user-definable clipping planes
<STRONG>GL_MATRIX_MODE</STRONG> value
<STRONG>GL_NORMALIZE</STRONG> flag
<STRONG>GL_VIEWPORT_BIT</STRONG> Depth range (near and far)
Viewport origin and extent
<STRONG>glPopAttrib</STRONG> restores the values of the state variables saved
with the last
<STRONG>glPushAttrib</STRONG> 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.
<STRONG>NOTES</STRONG>
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 <STRONG>glPushClientAttrib</STRONG>.
The depth of the attribute stack depends on the
implementation, but it must be at least 16.
<STRONG>ERRORS</STRONG>
<STRONG>GL_STACK_OVERFLOW</STRONG> is generated if <STRONG>glPushAttrib</STRONG> is called
while the attribute stack is full.
<STRONG>GL_STACK_UNDERFLOW</STRONG> is generated if <STRONG>glPopAttrib</STRONG> is called
while the attribute stack is empty.
<STRONG>GL_INVALID_OPERATION</STRONG> is generated if <STRONG>glPushAttrib</STRONG> or
<STRONG>glPopAttrib</STRONG> is executed between the execution of <STRONG>glBegin</STRONG> and
the corresponding execution of <STRONG>glEnd</STRONG>.
<STRONG>ASSOCIATED</STRONG> <STRONG>GETS</STRONG>
<STRONG>glGet</STRONG> with argument <STRONG>GL_ATTRIB_STACK_DEPTH</STRONG>
<STRONG>glGet</STRONG> with argument <STRONG>GL_MAX_ATTRIB_STACK_DEPTH</STRONG>
<STRONG>SEE</STRONG> <STRONG>ALSO</STRONG>
<STRONG>glGet</STRONG>, <STRONG>glGetClipPlane</STRONG>, <STRONG>glGetError</STRONG>, <STRONG>glGetLight</STRONG>, <STRONG>glGetMap</STRONG>,
<STRONG>glGetMaterial</STRONG>,
<STRONG>glGetPixelMap</STRONG>, <STRONG>glGetPolygonStipple</STRONG>, <STRONG>glGetString</STRONG>,
<STRONG>glGetTexEnv</STRONG>, <STRONG>glGetTexGen</STRONG>, <STRONG>glGetTexImage</STRONG>,
<STRONG>glGetTexLevelParameter</STRONG>, <STRONG>glGetTexParameter</STRONG>, <STRONG>glIsEnabled</STRONG>,
<STRONG>glPushClientAttrib</STRONG>
</PRE>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -