aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/extras/ogl-sample/main/doc/man/mangl/standard/pushattrib.gl
blob: a1b1001b9c04f21ad10bb01eb66541f92cccf5e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
_C_ License Applicability. Except to the extent portions of this file are
_C_ made subject to an alternative license as permitted in the SGI Free
_C_ Software License B, Version 1.1 (the "License"), the contents of this
_C_ file are subject only to the provisions of the License. You may not use
_C_ this file except in compliance with the License. You may obtain a copy
_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
_C_ 
_C_ http://oss.sgi.com/projects/FreeB
_C_ 
_C_ Note that, as provided in the License, the Software is distributed on an
_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
_C_ 
_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
_C_ Copyright in any portions created by third parties is as indicated
_C_ elsewhere herein. All Rights Reserved.
_C_ 
_C_ Additional Notice Provisions: The application programming interfaces
_C_ established by SGI in conjunction with the Original Code are The
_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
_C_ published by SGI, but has not been independently verified as being
_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
_C_
_C_ The first character in this file must be an '_'!
_C_ Anything on a line after _C_ is ignored
_define(_filters,eqn|tbl)_C_
_header(PushAttrib,push and pop the server attribute stack)
_names(PushAttrib)
.SH PARAMETERS
_phead(_param1)
Specifies a mask that indicates which attributes to save. Values for
_param1 are listed below.
_names(PopAttrib)
.SH DESCRIPTION
_cmnd 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.
_param1(1)
is typically constructed by ORing several of these constants together.
The special mask
_const(ALL_ATTRIB_BITS)
can be used to save all stackable states.
.P
The symbolic mask constants and their associated GL state are as follows
(the second column lists which attributes are saved):
.P
.TS
;
l l .
_const(ACCUM_BUFFER_BIT)	Accumulation buffer clear value

_const(COLOR_BUFFER_BIT)	_const(ALPHA_TEST) enable bit
	Alpha test function and reference value
	_const(BLEND) enable bit
	Blending source and destination functions
	Constant blend color
	Blending equation
	_const(DITHER) enable bit
	_const(DRAW_BUFFER) setting
	_const(COLOR_LOGIC_OP) enable bit
	_const(INDEX_LOGIC_OP) enable bit
	Logic op function
	Color mode and index mode clear values
	Color mode and index mode writemasks

_const(CURRENT_BIT)	Current RGBA color
	Current color index
	Current normal vector
	Current texture coordinates
	Current raster position
	_const(CURRENT_RASTER_POSITION_VALID) flag
	RGBA color associated with current raster position
	Color index associated with current raster position
	Texture coordinates associated with current raster position
	_const(EDGE_FLAG) flag

_const(DEPTH_BUFFER_BIT)	_const(DEPTH_TEST) enable bit
	Depth buffer test function
	Depth buffer clear value
	_const(DEPTH_WRITEMASK) enable bit

_const(ENABLE_BIT)	_const(ALPHA_TEST) flag
	_const(AUTO_NORMAL) flag
	_const(BLEND) flag
	Enable bits for the user-definable clipping planes
	_const(COLOR_MATERIAL)
	_const(CULL_FACE) flag
	_const(DEPTH_TEST) flag
	_const(DITHER) flag
	_const(FOG) flag
	_const(LIGHT)\f2i\fP where 0\ <= \f2i\fP<_const(MAX_LIGHTS)
	_const(LIGHTING) flag
	_const(LINE_SMOOTH) flag
	_const(LINE_STIPPLE) flag
	_const(COLOR_LOGIC_OP) flag
	_const(INDEX_LOGIC_OP) flag
	_const(MAP1_)\f2x\fP where \f2x\fP is a map type
	_const(MAP2_)\f2x\fP where \f2x\fP is a map type
	_const(NORMALIZE) flag
	_const(POINT_SMOOTH) flag
	_const(POLYGON_OFFSET_LINE) flag
	_const(POLYGON_OFFSET_FILL) flag
	_const(POLYGON_OFFSET_POINT) flag
	_const(POLYGON_SMOOTH) flag
	_const(POLYGON_STIPPLE) flag
	_const(SCISSOR_TEST) flag
	_const(STENCIL_TEST) flag
	_const(TEXTURE_1D) flag
	_const(TEXTURE_2D) flag
	_const(TEXTURE_3D) flag
	Flags _const(TEXTURE_GEN_)\f2x\fP where \f2x\fP is S, T, R, or Q 

_const(EVAL_BIT)	_const(MAP1_)\f2x\fP enable bits, where \f2x\fP is a map type
	_const(MAP2_)\f2x\fP enable bits, where \f2x\fP is a map type
	1D grid endpoints and divisions
	2D grid endpoints and divisions
	_const(AUTO_NORMAL) enable bit

_const(FOG_BIT)	_const(FOG) enable bit
	Fog color
	Fog density
	Linear fog start
	Linear fog end
	Fog index
	_const(FOG_MODE) value

_const(HINT_BIT)	_const(PERSPECTIVE_CORRECTION_HINT) setting
	_const(POINT_SMOOTH_HINT) setting
	_const(LINE_SMOOTH_HINT) setting
	_const(POLYGON_SMOOTH_HINT) setting
	_const(FOG_HINT) setting

_const(LIGHTING_BIT)	_const(COLOR_MATERIAL) enable bit
	_const(COLOR_MATERIAL_FACE) value
	Color material parameters that are tracking the current color
	Ambient scene color
	_const(LIGHT_MODEL_LOCAL_VIEWER) value
	_const(LIGHT_MODEL_TWO_SIDE) setting
	_const(LIGHTING) 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
	_const(SHADE_MODEL) setting

_const(LINE_BIT)	_const(LINE_SMOOTH) flag
	_const(LINE_STIPPLE) enable bit
	Line stipple pattern and repeat counter
	Line width

_const(LIST_BIT)	_const(LIST_BASE) setting

_const(PIXEL_MODE_BIT)	_const(RED_BIAS) and _const(RED_SCALE) settings
	_const(GREEN_BIAS) and _const(GREEN_SCALE) values
	_const(BLUE_BIAS) and _const(BLUE_SCALE)
	_const(ALPHA_BIAS) and _const(ALPHA_SCALE)
	_const(DEPTH_BIAS) and _const(DEPTH_SCALE)
	_const(INDEX_OFFSET) and _const(INDEX_SHIFT) values
	_const(MAP_COLOR) and _const(MAP_STENCIL) flags
	_const(ZOOM_X) and _const(ZOOM_Y) factors
	_const(READ_BUFFER) setting

_const(POINT_BIT)	_const(POINT_SMOOTH) flag
	Point size

_const(POLYGON_BIT)	_const(CULL_FACE) enable bit
	_const(CULL_FACE_MODE) value
	_const(FRONT_FACE) indicator
	_const(POLYGON_MODE) setting
	_const(POLYGON_SMOOTH) flag
	_const(POLYGON_STIPPLE) enable bit
	_const(POLYGON_OFFSET_FILL) flag
	_const(POLYGON_OFFSET_LINE) flag
	_const(POLYGON_OFFSET_POINT) flag
	_const(POLYGON_OFFSET_FACTOR)
	_const(POLYGON_OFFSET_UNITS)

_const(POLYGON_STIPPLE_BIT)	Polygon stipple image

_const(SCISSOR_BIT)	_const(SCISSOR_TEST) flag
	Scissor box

_const(STENCIL_BUFFER_BIT)	_const(STENCIL_TEST) 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

_const(TEXTURE_BIT)	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 _const(TEXTURE_GEN_)\f2x\fP, \f2x\fP is S, T, R, and Q 
	_const(TEXTURE_GEN_MODE) setting for S, T, R, and Q
	_cmnd(TexGen) plane equations for S, T, R, and Q
	Current texture bindings (for example, _const(TEXTURE_BINDING_2D))

_const(TRANSFORM_BIT)	Coefficients of the six clipping planes
	Enable bits for the user-definable clipping planes
	_const(MATRIX_MODE) value
	_const(NORMALIZE) flag
	_const(RESCALE_NORMAL) flag

_const(VIEWPORT_BIT)	Depth range (near and far)
	Viewport origin and extent
.TE
.P
_cmnd(PopAttrib) restores the values of the state variables saved with the last
.br
_cmnd(PushAttrib) command.
Those not saved are left unchanged.
.P
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.
.P
Initially, the attribute stack is empty.
.SH NOTES
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 
_cmnd(PushClientAttrib).
.P
The depth of the attribute stack depends on the implementation,
but it must be at least 16.
.P
When the _arbstring(multitexture) extension is supported, pushing and
popping texture state applies to all supported texture units.
.SH ERRORS
_const(STACK_OVERFLOW) is generated if _cmnd(PushAttrib) is called while
the attribute stack is full.
.P
_const(STACK_UNDERFLOW) is generated if _cmnd(PopAttrib) is called while
the attribute stack is empty.
.P
_const(INVALID_OPERATION) is generated if _cmnd(PushAttrib) or _cmnd(PopAttrib)
is executed between the execution of _cmnd(Begin)
and the corresponding execution of _cmnd(End).
.SH ASSOCIATED GETS 
_cmnd(Get) with argument _const(ATTRIB_STACK_DEPTH)
.br
_cmnd(Get) with argument _const(MAX_ATTRIB_STACK_DEPTH)
.SH SEE ALSO
_cmnd(Get),
_cmnd(GetClipPlane),
_cmnd(GetError),
_cmnd(GetLight),
_cmnd(GetMap),
_cmnd(GetMaterial),
.br
_cmnd(GetPixelMap),
_cmnd(GetPolygonStipple),
_cmnd(GetString),
_cmnd(GetTexEnv),
_cmnd(GetTexGen),
_cmnd(GetTexImage),
_cmnd(GetTexLevelParameter),
_cmnd(GetTexParameter),
_cmnd(IsEnabled),
_cmnd(PushClientAttrib)