glpushattrib - Man Page






glPushAttrib(3G)	       OpenGL Reference		      glPushAttrib(3G)



NAME
     glPushAttrib, glPopAttrib - push and pop the attribute stack


C SPECIFICATION
     void glPushAttrib(	GLbitfield mask	)


PARAMETERS
     mask  Specifies a mask that indicates which attributes to save.  Values
	   for mask are	listed in the table below.

C SPECIFICATION
     void glPopAttrib( void )


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_LOGIC_OP enable bit
			      Logic op function
			      Color mode and index mode	clear values
			      Color mode and index mode	writemasks

     GL_CURRENT_BIT	      Current RGBA color
			      Current color index
			      Current normal vector
			      Current texture coordinates
			      Current raster position
			      GL_CURRENT_RASTER_POSITION_VALID enable bit
			      RGBA color associated with current raster
				  position
			      Color index associated with current raster





									Page 1






glPushAttrib(3G)	       OpenGL Reference		      glPushAttrib(3G)



				  position
			 Texture coordinates associated	with current
			     raster position
			 GL_EDGE_FLAG enable bit

GL_DEPTH_BUFFER_BIT	 GL_DEPTH_TEST enable bit
			 Depth buffer test function
			 Depth buffer clear value
			 GL_DEPTH_WRITEMASK enable bit

GL_ENABLE_BIT		 GL_ALPHA_TEST enable bit
			 GL_AUTO_NORMAL	enable bit
			 GL_BLEND enable bit
			 GL_CLIP_PLANEi	enable bits
			 GL_COLOR_MATERIAL
			 GL_CONVOLUTION_1D_EXT,
			     GL_CONVOLUTION_2D_EXT, and
			     GL_SEPARABLE_2D_EXT enable	bits
			 GL_COLOR_TABLE_SGI enable bit
			 GL_CULL_FACE enable bit
			 GL_DEPTH_TEST enable bit
			 GL_DITHER enable bit
			 GL_FOG	enable bit
			 GL_HISTOGRAM_EXT enable bit
			 GL_INTERLACE_SGIX enable bit
			 GL_LIGHTi where 0 <= iglPushAttrib(3G)	       OpenGL Reference		      glPushAttrib(3G)



			 Enable	bits GL_TEXTURE_GEN_x where x is S, T, R, or Q

GL_EVAL_BIT		 GL_MAP1_x enable bits,	where x	is a map type
			 GL_MAP2_x enable bits,	where x	is a map type
			 1-D grid endpoints and	divisions
			 2-D grid endpoints and	divisions
			 GL_AUTO_NORMAL	enable bit

GL_FOG_BIT		 GL_FOG	enable bit
			 Fog color
			 Fog density
			 Linear	fog start
			 Linear	fog end
			 Fog index
			 GL_FOG_MODE value
			 Control points	for custom fog blending	function
			 Number	of control points
			 GL_FOG_OFFSET_SGIX enable bit
			 Fog offset parameters

GL_HINT_BIT		 GL_PERSPECTIVE_CORRECTION_HINT	setting
			 GL_POINT_SMOOTH_HINT setting
			 GL_LINE_SMOOTH_HINT setting
			 GL_POLYGON_SMOOTH_HINT	setting
			 GL_FOG_HINT setting

GL_LIGHTING_BIT		 GL_COLOR_MATERIAL enable bit
			 GL_COLOR_MATERIAL_FACE	value
			 Color material	parameters that	are tracking the
			     current color
			 Ambient scene color
			 GL_LIGHT_MODEL_LOCAL_VIEWER value
			 GL_LIGHT_MODEL_TWO_SIDE setting
			 GL_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
			 GL_SHADE_MODEL	setting

GL_LINE_BIT		 GL_LINE_SMOOTH	enable bit
			 GL_LINE_STIPPLE enable	bit





									Page 3






glPushAttrib(3G)	       OpenGL Reference		      glPushAttrib(3G)



			 Line stipple pattern and repeat counter
			 Line width

GL_LIST_BIT		 GL_LIST_BASE setting

GL_MULTISAMPLE_BIT_EXT	 GL_MULTISAMPLE_SGIS enable bit
			 GL_SAMPLE_ALPHA_TO_MASK_SGIS enable bit
			 GL_SAMPLE_ALPHA_TO_ONE_SGIS enable bit
			 GL_SAMPLE_MASK_SGIS enable bit
			 GL_SAMPLE_MASK_VALUE_SGIS
			 GL_SAMPLE_MASK_INVERT_SGIS
			 GL_SAMPLE_PATTERN_SGIS

GL_PIXEL_MODE_BIT	 GL_RED_BIAS and GL_RED_SCALE values
			 GL_GREEN_BIAS and GL_GREEN_SCALE
			 GL_BLUE_BIAS and GL_BLUE_SCALE
			 GL_ALPHA_BIAS and GL_ALPHA_SCALE
			 GL_DEPTH_BIAS and GL_DEPTH_SCALE
			 GL_INDEX_OFFSET and GL_INDEX_SHIFT
			 GL_MAP_COLOR and GL_MAP_STENCIL enable	bits
			 GL_ZOOM_X and GL_ZOOM_Y factors
			 GL_READ_BUFFER	setting
			 Post-color-matrix scale and bias values
			 GL_COLOR_TABLE_SCALE_SGI and GL_COLOR_TABLE_BIAS_SGI
			     for all color tables
			 GL_CONVOLUTION_1D_EXT,
			     GL_CONVOLUTION_2D_EXT, and
			     GL_SEPARABLE_2D_EXT enable	bits
			 Convolution filter scale and bias values
			 Post-convolution pixel	scale and bias values
			 Convolution border mode
			 GL_HISTOGRAM_EXT enable bit
			 GL_MINMAX_EXT enable bit
			 GL_INTERLACE_SGIX enable bit

GL_POINT_BIT		 GL_POINT_SMOOTH enable	bit
			 Point size

GL_POLYGON_BIT		 GL_CULL_FACE enable bit
			 GL_CULL_FACE_MODE value
			 GL_FRONT_FACE indicator
			 GL_POLYGON_MODE setting
			 GL_POLYGON_SMOOTH enable bit
			 GL_POLYGON_STIPPLE enable bit
			 GL_POLYGON_OFFSET_EXT enable bit
			 GL_POLYGON_OFFSET_FACTOR_EXT
			 GL_POLYGON_OFFSET_BIAS_EXT

GL_POLYGON_STIPPLE_BIT	 Polygon stipple image






									Page 4






glPushAttrib(3G)	       OpenGL Reference		      glPushAttrib(3G)



GL_SCISSOR_BIT		 GL_SCISSOR_TEST enable	bit
			 Scissor box

GL_STENCIL_BUFFER_BIT	 GL_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

GL_TEXTURE_BIT		 Enable	bits for the four texture coordinates
			 Border	color for each texture target
			 Minification function for each	texture	target
			 Magnification function	for each texture target
			 Texture coordinates and wrap mode for each
			     texture target
			 Color,	mode, and bias for each	texture	environment
			 Enable	bits GL_TEXTURE_GEN_x, x is S, T, R, and Q
			 GL_TEXTURE_GEN_MODE setting for S, T, R, and Q
			 glTexGen plane	equations for S, T, R, and Q
			 Detail	texture	binding, level offset, mode,
			     and scaling function control points
			 Sharp texture scaling function	control	points
			 GL_TEXTURE_COLOR_TABLE_SGI enable bit
			 GL_TEXTURE_COLOR_TABLE_SCALE_SGI
			 GL_TEXTURE_COLOR_TABLE_BIAS_SGI
			 Current texture bindings
			     (e.g. GL_TEXTURE_2D_BINDING_EXT)
			 Minimum and maximum LOD clamping values
			 Base and maximum mipmap levels
			 Texture filter	function weights
			 Dual and quad texture group selection
			 Post-texture filter scale and bias values
			 Clipmap frame size, center, and offset
			 Texture comparison operator
			 Texture comparison enable
			 Shadow	ambient	lighting coefficient

GL_TRANSFORM_BIT	 Coefficients of the six clipping planes
			 GL_CLIP_PLANEi	enable bits
			 GL_MATRIX_MODE	value
			 GL_NORMALIZE enable bit
			 Coefficients of the reference plane

GL_VIEWPORT_BIT		 Depth range (near and far)
			 Viewport origin and extent

     glPopAttrib restores the values of	the state variables saved with the
     last  glPushAttrib	command.  Those	not saved are left unchanged.






									Page 5






glPushAttrib(3G)	       OpenGL Reference		      glPushAttrib(3G)



     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.


NOTES
     Not all values for	GL state can be	saved on the attribute stack.  For
     example, pixel pack and unpack state, render mode state, and select and
     feedback state cannot be saved.

     The depth of the attribute	stack depends on the implementation, but it
     must be at	least 16.

ERRORS
     GL_STACK_OVERFLOW is generated if glPushAttrib is called while the
     attribute stack is	full.

     GL_STACK_UNDERFLOW	is generated if	glPopAttrib is called while the
     attribute stack is	empty.

     GL_INVALID_OPERATION is generated if glPushattrib or glPopAttrib is
     executed between the execution of glBegin and the corresponding execution
     of	glEnd.

ASSOCIATED GETS
     glGet with	argument GL_ATTRIB_STACK_DEPTH.
     glGet with	argument GL_MAX_ATTRIB_STACK_DEPTH.


MACHINE	DEPENDENCIES
     GL_COLOR_TABLE_SGI, GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI and
     GL_POST_CONVOLUTION_COLOR_TABLE_SGI are part of the SGI_color_table
     extension which is	not supported on RealityEngine,	RealityEngine2,	and
     VTX systems.

     On	RealityEngine, RealityEngine2, and VTX and High	Impact and Maximum
     Impact systems there is no	support	for pushing or popping attributes
     related to	detail texturing.

     The SGIX_interlace	extension is supported only on InfiniteReality systems
     and on RealityEngine, RealityEngine2, and VTX systems.

     Before popping state that is transformed by the modelview matrix at the
     time it is	specified (e.g.	light positions, user clipping planes, etc.)
     on	InfiniteReality	systems	it is necessary	to set the modelview matrix to
     its value at the time the state was originally specified.	This is
     because the popped	state is re-transformed	by the modelview matrix	at the
     time of the pop.  This definitely will be fixed in	the next release.





									Page 6






glPushAttrib(3G)	       OpenGL Reference		      glPushAttrib(3G)



     High Impact and Maximum Impact systems support this function for 1D and
     2D	textures only, and also	do not work properly if	texture	objects	are
     being used.  (see glBindTextureExt). This will be fixed in	the next
     release

     RealityEngine, RealityEngine2, and	VTX systems have no support for
     pushing or	popping	attributes related to sharpen texturing.

     On	InfiniteReality	systems, if the	post-texture filter scale and bias
     values are	set to values other than the defaults, they are	limited	to the
     range [0.0, 1.0).	(note: this range excludes 1.0.)  The
     SGIX_texture_scale_bias extension is not supported	on RealityEngine,
     RealityEngine2, and VTX systems or	on High	Impact and Maximum Impact
     systems.

     The SGIS_texture_select extension is supported only on InfiniteReality
     systems and on High Impact	and Maximum Impact systems with	the TRAM
     option card.


SEE ALSO
     glGet, glGetClipPlane, glGetError,	glGetLight, glGetMap, glGetMaterial,
     glGetPixelMap, glGetPolygonStipple, glGetString, glGetTexEnv,
     glGetTexGen, glGetTexImage, glGetTexLevelParameter, glGetTexParameter,
     glIsEnabled






























									Page 7