1GLPUSHATTRIB(3G)                                              GLPUSHATTRIB(3G)
2
3
4

NAME

6       glPushAttrib, glPopAttrib - push and pop the server attribute stack
7
8

C SPECIFICATION

10       void glPushAttrib( GLbitfield mask )
11
12

PARAMETERS

14       mask  Specifies  a mask that indicates which attributes to save. Values
15             for mask are listed below.
16

C SPECIFICATION

18       void glPopAttrib( void )
19
20

DESCRIPTION

22       glPushAttrib takes one argument, a mask that indicates which groups  of
23       state variables to save on the attribute stack.  Symbolic constants are
24       used to set bits in the mask.  mask is typically constructed  by  ORing
25       several    of    these    constants   together.    The   special   mask
26       GL_ALL_ATTRIB_BITS can be used to save all stackable states.
27
28       The symbolic mask constants and their associated GL state are  as  fol‐
29       lows (the second column lists which attributes are saved):
30
31       GL_ACCUM_BUFFER_BIT      Accumulation buffer clear value
32
33       GL_COLOR_BUFFER_BIT      GL_ALPHA_TEST enable bit
34                                Alpha test function and reference value
35                                GL_BLEND enable bit
36                                Blending source and destination functions
37                                Constant blend color
38                                Blending equation
39                                GL_DITHER enable bit
40                                GL_DRAW_BUFFER setting
41                                GL_COLOR_LOGIC_OP enable bit
42                                GL_INDEX_LOGIC_OP enable bit
43                                Logic op function
44                                Color mode and index mode clear values
45                                Color mode and index mode writemasks
46
47       GL_CURRENT_BIT           Current RGBA color
48                                Current color index
49                                Current normal vector
50                                Current texture coordinates
51                                Current raster position
52                                GL_CURRENT_RASTER_POSITION_VALID flag
53                                RGBA color associated with current raster position
54                                Color index associated with current raster position
55                                Texture coordinates associated with current raster position
56                                GL_EDGE_FLAG flag
57
58       GL_DEPTH_BUFFER_BIT      GL_DEPTH_TEST enable bit
59                                Depth buffer test function
60                                Depth buffer clear value
61                                GL_DEPTH_WRITEMASK enable bit
62
63       GL_ENABLE_BIT            GL_ALPHA_TEST flag
64                                GL_AUTO_NORMAL flag
65                                GL_BLEND flag
66
67                                Enable bits for the user-definable clipping planes
68                                GL_COLOR_MATERIAL
69                                GL_CULL_FACE flag
70                                GL_DEPTH_TEST flag
71                                GL_DITHER flag
72                                GL_FOG flag
73                                GL_LIGHTi where 0 <= i<GL_MAX_LIGHTS
74                                GL_LIGHTING flag
75                                GL_LINE_SMOOTH flag
76                                GL_LINE_STIPPLE flag
77                                GL_COLOR_LOGIC_OP flag
78                                GL_INDEX_LOGIC_OP flag
79                                GL_MAP1_x where x is a map type
80                                GL_MAP2_x where x is a map type
81                                GL_NORMALIZE flag
82                                GL_POINT_SMOOTH flag
83                                GL_POLYGON_OFFSET_LINE flag
84                                GL_POLYGON_OFFSET_FILL flag
85                                GL_POLYGON_OFFSET_POINT flag
86                                GL_POLYGON_SMOOTH flag
87                                GL_POLYGON_STIPPLE flag
88                                GL_SCISSOR_TEST flag
89                                GL_STENCIL_TEST flag
90                                GL_TEXTURE_1D flag
91                                GL_TEXTURE_2D flag
92                                GL_TEXTURE_3D flag
93                                Flags GL_TEXTURE_GEN_x where x is S, T, R, or Q
94
95       GL_EVAL_BIT              GL_MAP1_x enable bits, where x is a map type
96                                GL_MAP2_x enable bits, where x is a map type
97                                1D grid endpoints and divisions
98                                2D grid endpoints and divisions
99                                GL_AUTO_NORMAL enable bit
100
101       GL_FOG_BIT               GL_FOG enable bit
102                                Fog color
103                                Fog density
104                                Linear fog start
105                                Linear fog end
106                                Fog index
107                                GL_FOG_MODE value
108
109       GL_HINT_BIT              GL_PERSPECTIVE_CORRECTION_HINT setting
110                                GL_POINT_SMOOTH_HINT setting
111                                GL_LINE_SMOOTH_HINT setting
112                                GL_POLYGON_SMOOTH_HINT setting
113                                GL_FOG_HINT setting
114
115       GL_LIGHTING_BIT          GL_COLOR_MATERIAL enable bit
116                                GL_COLOR_MATERIAL_FACE value
117                                Color material parameters that are tracking the current color
118                                Ambient scene color
119                                GL_LIGHT_MODEL_LOCAL_VIEWER value
120                                GL_LIGHT_MODEL_TWO_SIDE setting
121                                GL_LIGHTING enable bit
122                                Enable bit for each light
123                                Ambient, diffuse, and specular intensity for each light
124                                Direction, position, exponent, and cutoff angle for each light
125                                Constant, linear, and quadratic attenuation factors for each light
126                                Ambient, diffuse, specular, and emissive color for each material
127                                Ambient, diffuse, and specular color indices for each material
128                                Specular exponent for each material
129                                GL_SHADE_MODEL setting
130
131       GL_LINE_BIT              GL_LINE_SMOOTH flag
132
133                                GL_LINE_STIPPLE enable bit
134                                Line stipple pattern and repeat counter
135                                Line width
136
137       GL_LIST_BIT              GL_LIST_BASE setting
138
139       GL_PIXEL_MODE_BIT        GL_RED_BIAS and GL_RED_SCALE settings
140                                GL_GREEN_BIAS and GL_GREEN_SCALE values
141                                GL_BLUE_BIAS and GL_BLUE_SCALE
142                                GL_ALPHA_BIAS and GL_ALPHA_SCALE
143                                GL_DEPTH_BIAS and GL_DEPTH_SCALE
144                                GL_INDEX_OFFSET and GL_INDEX_SHIFT values
145                                GL_MAP_COLOR and GL_MAP_STENCIL flags
146                                GL_ZOOM_X and GL_ZOOM_Y factors
147                                GL_READ_BUFFER setting
148
149       GL_POINT_BIT             GL_POINT_SMOOTH flag
150                                Point size
151
152       GL_POLYGON_BIT           GL_CULL_FACE enable bit
153                                GL_CULL_FACE_MODE value
154                                GL_FRONT_FACE indicator
155                                GL_POLYGON_MODE setting
156                                GL_POLYGON_SMOOTH flag
157                                GL_POLYGON_STIPPLE enable bit
158                                GL_POLYGON_OFFSET_FILL flag
159                                GL_POLYGON_OFFSET_LINE flag
160                                GL_POLYGON_OFFSET_POINT flag
161                                GL_POLYGON_OFFSET_FACTOR
162                                GL_POLYGON_OFFSET_UNITS
163
164       GL_POLYGON_STIPPLE_BIT   Polygon stipple image
165
166       GL_SCISSOR_BIT           GL_SCISSOR_TEST flag
167                                Scissor box
168
169       GL_STENCIL_BUFFER_BIT    GL_STENCIL_TEST enable bit
170                                Stencil function and reference value
171                                Stencil value mask
172                                Stencil fail, pass, and depth buffer pass actions
173                                Stencil buffer clear value
174                                Stencil buffer writemask
175
176       GL_TEXTURE_BIT           Enable bits for the four texture coordinates
177                                Border color for each texture image
178                                Minification function for each texture image
179                                Magnification function for each texture image
180                                Texture coordinates and wrap mode for each texture image
181                                Color and mode for each texture environment
182                                Enable bits GL_TEXTURE_GEN_x, x is S, T, R, and Q
183                                GL_TEXTURE_GEN_MODE setting for S, T, R, and Q
184                                glTexGen plane equations for S, T, R, and Q
185                                Current texture bindings (for example, GL_TEXTURE_BINDING_2D)
186
187       GL_TRANSFORM_BIT         Coefficients of the six clipping planes
188                                Enable bits for the user-definable clipping planes
189                                GL_MATRIX_MODE value
190                                GL_NORMALIZE flag
191                                GL_RESCALE_NORMAL flag
192
193       GL_VIEWPORT_BIT          Depth range (near and far)
194                                Viewport origin and extent
195
196       glPopAttrib  restores  the values of the state variables saved with the
197       last
198       glPushAttrib command.  Those not saved are left unchanged.
199
200       It is an error to  push  attributes  onto  a  full  stack,  or  to  pop
201       attributes  off  an empty stack.  In either case, the error flag is set
202       and no other change is made to GL state.
203
204       Initially, the attribute stack is empty.
205

NOTES

207       Not all values for GL state can be saved on the attribute  stack.   For
208       example,  render  mode  state,  and select and feedback state cannot be
209       saved.  Client state must be saved with glPushClientAttrib.
210
211       The depth of the attribute stack depends on the implementation, but  it
212       must be at least 16.
213
214       When  the  GL_ARB_multitexture extension is supported, pushing and pop‐
215       ping texture state apples to all supported texture units.
216

ERRORS

218       GL_STACK_OVERFLOW is generated if  glPushAttrib  is  called  while  the
219       attribute stack is full.
220
221       GL_STACK_UNDERFLOW  is  generated  if  glPopAttrib  is called while the
222       attribute stack is empty.
223
224       GL_INVALID_OPERATION is generated if  glPushAttrib  or  glPopAttrib  is
225       executed  between the execution of glBegin and the corresponding execu‐
226       tion of glEnd.
227

ASSOCIATED GETS

229       glGet with argument GL_ATTRIB_STACK_DEPTH
230       glGet with argument GL_MAX_ATTRIB_STACK_DEPTH
231

SEE ALSO

233       glGet(3G),    glGetClipPlane(3G),    glGetError(3G),    glGetLight(3G),
234       glGetMap(3G), glGetMaterial(3G),
235       glGetPixelMap(3G),       glGetPolygonStipple(3G),      glGetString(3G),
236       glGetTexEnv(3G),          glGetTexGen(3G),           glGetTexImage(3G),
237       glGetTexLevelParameter(3G),   glGetTexParameter(3G),   glIsEnabled(3G),
238       glPushClientAttrib(3G)
239
240
241
242                                                              GLPUSHATTRIB(3G)
Impressum