5
.ds Dt 24 September 1999
9
.ds Xs 21569 10 pushattrib.gl
12
.B "glPushAttrib, glPopAttrib
13
\- push and pop the server attribute stack
16
void \f3glPushAttrib\fP(
17
GLbitfield \fImask\fP )
22
.TP \w'\f2mask\fP\ \ 'u
24
Specifies a mask that indicates which attributes to save. Values for
25
\f2mask\fP are listed below.
27
void \f3glPopAttrib\fP( void )
32
\%\f3glPushAttrib\fP takes one argument,
33
a mask that indicates which groups of state variables
34
to save on the attribute stack.
35
Symbolic constants are used to set bits in the mask.
37
is typically constructed by ORing several of these constants together.
39
\%\f3GL_ALL_ATTRIB_BITS\fP
40
can be used to save all stackable states.
42
The symbolic mask constants and their associated GL state are as follows
43
(the second column lists which attributes are saved):
48
\%\f3GL_ACCUM_BUFFER_BIT\fP Accumulation buffer clear value
50
\%\f3GL_COLOR_BUFFER_BIT\fP \%\f3GL_ALPHA_TEST\fP enable bit
51
Alpha test function and reference value
52
\%\f3GL_BLEND\fP enable bit
53
Blending source and destination functions
56
\%\f3GL_DITHER\fP enable bit
57
\%\f3GL_DRAW_BUFFER\fP setting
58
\%\f3GL_COLOR_LOGIC_OP\fP enable bit
59
\%\f3GL_INDEX_LOGIC_OP\fP enable bit
61
Color mode and index mode clear values
62
Color mode and index mode writemasks
64
\%\f3GL_CURRENT_BIT\fP Current RGBA color
67
Current texture coordinates
68
Current raster position
69
\%\f3GL_CURRENT_RASTER_POSITION_VALID\fP flag
70
RGBA color associated with current raster position
71
Color index associated with current raster position
72
Texture coordinates associated with current raster position
73
\%\f3GL_EDGE_FLAG\fP flag
75
\%\f3GL_DEPTH_BUFFER_BIT\fP \%\f3GL_DEPTH_TEST\fP enable bit
76
Depth buffer test function
77
Depth buffer clear value
78
\%\f3GL_DEPTH_WRITEMASK\fP enable bit
80
\%\f3GL_ENABLE_BIT\fP \%\f3GL_ALPHA_TEST\fP flag
81
\%\f3GL_AUTO_NORMAL\fP flag
83
Enable bits for the user-definable clipping planes
84
\%\f3GL_COLOR_MATERIAL\fP
85
\%\f3GL_CULL_FACE\fP flag
86
\%\f3GL_DEPTH_TEST\fP flag
87
\%\f3GL_DITHER\fP flag
89
\%\f3GL_LIGHT\fP\f2i\fP where 0\ <= \f2i\fP<\%\f3GL_MAX_LIGHTS\fP
90
\%\f3GL_LIGHTING\fP flag
91
\%\f3GL_LINE_SMOOTH\fP flag
92
\%\f3GL_LINE_STIPPLE\fP flag
93
\%\f3GL_COLOR_LOGIC_OP\fP flag
94
\%\f3GL_INDEX_LOGIC_OP\fP flag
95
\%\f3GL_MAP1_\fP\f2x\fP where \f2x\fP is a map type
96
\%\f3GL_MAP2_\fP\f2x\fP where \f2x\fP is a map type
97
\%\f3GL_NORMALIZE\fP flag
98
\%\f3GL_POINT_SMOOTH\fP flag
99
\%\f3GL_POLYGON_OFFSET_LINE\fP flag
100
\%\f3GL_POLYGON_OFFSET_FILL\fP flag
101
\%\f3GL_POLYGON_OFFSET_POINT\fP flag
102
\%\f3GL_POLYGON_SMOOTH\fP flag
103
\%\f3GL_POLYGON_STIPPLE\fP flag
104
\%\f3GL_SCISSOR_TEST\fP flag
105
\%\f3GL_STENCIL_TEST\fP flag
106
\%\f3GL_TEXTURE_1D\fP flag
107
\%\f3GL_TEXTURE_2D\fP flag
108
\%\f3GL_TEXTURE_3D\fP flag
109
Flags \%\f3GL_TEXTURE_GEN_\fP\f2x\fP where \f2x\fP is S, T, R, or Q
111
\%\f3GL_EVAL_BIT\fP \%\f3GL_MAP1_\fP\f2x\fP enable bits, where \f2x\fP is a map type
112
\%\f3GL_MAP2_\fP\f2x\fP enable bits, where \f2x\fP is a map type
113
1D grid endpoints and divisions
114
2D grid endpoints and divisions
115
\%\f3GL_AUTO_NORMAL\fP enable bit
117
\%\f3GL_FOG_BIT\fP \%\f3GL_FOG\fP enable bit
123
\%\f3GL_FOG_MODE\fP value
125
\%\f3GL_HINT_BIT\fP \%\f3GL_PERSPECTIVE_CORRECTION_HINT\fP setting
126
\%\f3GL_POINT_SMOOTH_HINT\fP setting
127
\%\f3GL_LINE_SMOOTH_HINT\fP setting
128
\%\f3GL_POLYGON_SMOOTH_HINT\fP setting
129
\%\f3GL_FOG_HINT\fP setting
131
\%\f3GL_LIGHTING_BIT\fP \%\f3GL_COLOR_MATERIAL\fP enable bit
132
\%\f3GL_COLOR_MATERIAL_FACE\fP value
133
Color material parameters that are tracking the current color
135
\%\f3GL_LIGHT_MODEL_LOCAL_VIEWER\fP value
136
\%\f3GL_LIGHT_MODEL_TWO_SIDE\fP setting
137
\%\f3GL_LIGHTING\fP enable bit
138
Enable bit for each light
139
Ambient, diffuse, and specular intensity for each light
140
Direction, position, exponent, and cutoff angle for each light
141
Constant, linear, and quadratic attenuation factors for each light
142
Ambient, diffuse, specular, and emissive color for each material
143
Ambient, diffuse, and specular color indices for each material
144
Specular exponent for each material
145
\%\f3GL_SHADE_MODEL\fP setting
147
\%\f3GL_LINE_BIT\fP \%\f3GL_LINE_SMOOTH\fP flag
148
\%\f3GL_LINE_STIPPLE\fP enable bit
149
Line stipple pattern and repeat counter
152
\%\f3GL_LIST_BIT\fP \%\f3GL_LIST_BASE\fP setting
154
\%\f3GL_PIXEL_MODE_BIT\fP \%\f3GL_RED_BIAS\fP and \%\f3GL_RED_SCALE\fP settings
155
\%\f3GL_GREEN_BIAS\fP and \%\f3GL_GREEN_SCALE\fP values
156
\%\f3GL_BLUE_BIAS\fP and \%\f3GL_BLUE_SCALE\fP
157
\%\f3GL_ALPHA_BIAS\fP and \%\f3GL_ALPHA_SCALE\fP
158
\%\f3GL_DEPTH_BIAS\fP and \%\f3GL_DEPTH_SCALE\fP
159
\%\f3GL_INDEX_OFFSET\fP and \%\f3GL_INDEX_SHIFT\fP values
160
\%\f3GL_MAP_COLOR\fP and \%\f3GL_MAP_STENCIL\fP flags
161
\%\f3GL_ZOOM_X\fP and \%\f3GL_ZOOM_Y\fP factors
162
\%\f3GL_READ_BUFFER\fP setting
164
\%\f3GL_POINT_BIT\fP \%\f3GL_POINT_SMOOTH\fP flag
167
\%\f3GL_POLYGON_BIT\fP \%\f3GL_CULL_FACE\fP enable bit
168
\%\f3GL_CULL_FACE_MODE\fP value
169
\%\f3GL_FRONT_FACE\fP indicator
170
\%\f3GL_POLYGON_MODE\fP setting
171
\%\f3GL_POLYGON_SMOOTH\fP flag
172
\%\f3GL_POLYGON_STIPPLE\fP enable bit
173
\%\f3GL_POLYGON_OFFSET_FILL\fP flag
174
\%\f3GL_POLYGON_OFFSET_LINE\fP flag
175
\%\f3GL_POLYGON_OFFSET_POINT\fP flag
176
\%\f3GL_POLYGON_OFFSET_FACTOR\fP
177
\%\f3GL_POLYGON_OFFSET_UNITS\fP
179
\%\f3GL_POLYGON_STIPPLE_BIT\fP Polygon stipple image
181
\%\f3GL_SCISSOR_BIT\fP \%\f3GL_SCISSOR_TEST\fP flag
184
\%\f3GL_STENCIL_BUFFER_BIT\fP \%\f3GL_STENCIL_TEST\fP enable bit
185
Stencil function and reference value
187
Stencil fail, pass, and depth buffer pass actions
188
Stencil buffer clear value
189
Stencil buffer writemask
191
\%\f3GL_TEXTURE_BIT\fP Enable bits for the four texture coordinates
192
Border color for each texture image
193
Minification function for each texture image
194
Magnification function for each texture image
195
Texture coordinates and wrap mode for each texture image
196
Color and mode for each texture environment
197
Enable bits \%\f3GL_TEXTURE_GEN_\fP\f2x\fP, \f2x\fP is S, T, R, and Q
198
\%\f3GL_TEXTURE_GEN_MODE\fP setting for S, T, R, and Q
199
\%\f3glTexGen\fP plane equations for S, T, R, and Q
200
Current texture bindings (for example, \%\f3GL_TEXTURE_BINDING_2D\fP)
202
\%\f3GL_TRANSFORM_BIT\fP Coefficients of the six clipping planes
203
Enable bits for the user-definable clipping planes
204
\%\f3GL_MATRIX_MODE\fP value
205
\%\f3GL_NORMALIZE\fP flag
206
\%\f3GL_RESCALE_NORMAL\fP flag
208
\%\f3GL_VIEWPORT_BIT\fP Depth range (near and far)
209
Viewport origin and extent
212
\%\f3glPopAttrib\fP restores the values of the state variables saved with the last
214
\%\f3glPushAttrib\fP command.
215
Those not saved are left unchanged.
217
It is an error to push attributes onto a full stack,
218
or to pop attributes off an empty stack.
219
In either case, the error flag is set
220
and no other change is made to GL state.
222
Initially, the attribute stack is empty.
224
Not all values for GL state can be saved on the attribute stack.
227
and select and feedback state cannot be saved.
228
Client state must be saved with
229
\%\f3glPushClientAttrib\fP.
231
The depth of the attribute stack depends on the implementation,
232
but it must be at least 16.
234
When the \%\f3GL_ARB_multitexture\fP extension is supported, pushing and
235
popping texture state apples to all supported texture units.
237
\%\f3GL_STACK_OVERFLOW\fP is generated if \%\f3glPushAttrib\fP is called while
238
the attribute stack is full.
240
\%\f3GL_STACK_UNDERFLOW\fP is generated if \%\f3glPopAttrib\fP is called while
241
the attribute stack is empty.
243
\%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glPushAttrib\fP or \%\f3glPopAttrib\fP
244
is executed between the execution of \%\f3glBegin\fP
245
and the corresponding execution of \%\f3glEnd\fP.
247
\%\f3glGet\fP with argument \%\f3GL_ATTRIB_STACK_DEPTH\fP
249
\%\f3glGet\fP with argument \%\f3GL_MAX_ATTRIB_STACK_DEPTH\fP
252
\%\f3glGetClipPlane(3G)\fP,
253
\%\f3glGetError(3G)\fP,
254
\%\f3glGetLight(3G)\fP,
255
\%\f3glGetMap(3G)\fP,
256
\%\f3glGetMaterial(3G)\fP,
258
\%\f3glGetPixelMap(3G)\fP,
259
\%\f3glGetPolygonStipple(3G)\fP,
260
\%\f3glGetString(3G)\fP,
261
\%\f3glGetTexEnv(3G)\fP,
262
\%\f3glGetTexGen(3G)\fP,
263
\%\f3glGetTexImage(3G)\fP,
264
\%\f3glGetTexLevelParameter(3G)\fP,
265
\%\f3glGetTexParameter(3G)\fP,
266
\%\f3glIsEnabled(3G)\fP,
267
\%\f3glPushClientAttrib(3G)\fP