Porting greset

Porting greset

OpenGL replaces the IRIS GL function, greset, with the functions, glPushAttrib and glPopAttrib. Use these functions to save and restore groups of state variables. For example,

void glPushAttrib( GLbitfield mask );

This example takes a bitwise OR of symbolic constants, indicating which groups of state variables to push onto an attribute stack. Each constant refers to a group of state variables. The following table shows the attribute groups with their equivalent symbolic constant names. For a complete list of the OpenGL state variables associated with each constant, see glPushAttrib.

AttributeConstant
accumulation buffer clear valueGL_ACCUM_BUFFER_BIT
color bufferGL_COLOR_BUFFER_BIT
currentGL_CURRENT_BIT
depth bufferGL_DEPTH_BUFFER_BIT
enableGL_ENABLE_BIT
evaluatorsEGL_VAL_BIT
fogGL_FOG_BIT
GL_LIST_BASE settingGL_LIST_BIT
hint variablesGL_HINT_BIT
lighting variablesGL_LIGHTING_BIT
line drawing modeGL_LINE_BIT
pixel mode variablesGL_PIXEL_MODE_BIT
point variablesGL_POINT_BIT
polygonGL_POLYGON_BIT
polygon stippleGL_POLYGON_STIPPLE_BIT
scissorGL_SCISSOR_BIT
stencil bufferGL_STENCIL_BUFFER_BIT
textureGL_TEXTURE_BIT
transformGL_TRANSFORM_BIT
viewportGL_VIEWPORT_BIT
GL_ALL_ATTRIB_BITS

 

To restore the values of the state variables to those saved with the last glPushAttrib, simply call glPopAttrib. The variables you didn't save will remain unchanged. The attribute stack has a finite depth of at least 16.

 

 

Community Additions

ADD
Show:
© 2016 Microsoft