NAME

glPushAttrib, glPopAttrib - push and pop the server attribute stack

C SPECIFICATION

void ggllPPuusshhAAttttrriibb( GLbitfield _m_a_s_k )

        

PARAMETERS

_m_a_s_k
Specifies a mask that indicates which attributes to save. Values for _m_a_s_k are listed below.

C SPECIFICATION

void ggllPPooppAAttttrriibb( void )

        

DESCRIPTION

ggllPPuusshhAAttttrriibb 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. _m_a_s_k is typically constructed by ORing several of these constants together. The special mask GGLL__AALLLL__AATTTTRRIIBB__BBIITTSS 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):

;
l l .
GGLL__AACCCCUUMM__BBUUFFFFEERR__BBIITT     Accumulation buffer clear value
        

GGLL__CCOOLLOORR__BBUUFFFFEERR__BBIITT GGLL__AALLPPHHAA__TTEESSTT enable bit Alpha test function and reference value GGLL__BBLLEENNDD enable bit Blending source and destination functions Constant blend color Blending equation GGLL__DDIITTHHEERR enable bit GGLL__DDRRAAWW__BBUUFFFFEERR setting GGLL__CCOOLLOORR__LLOOGGIICC__OOPP enable bit GGLL__IINNDDEEXX__LLOOGGIICC__OOPP enable bit Logic op function Color mode and index mode clear values Color mode and index mode writemasks

GGLL__CCUURRRREENNTT__BBIITT Current RGBA color Current color index Current normal vector Current texture coordinates Current raster position GGLL__CCUURRRREENNTT__RRAASSTTEERR__PPOOSSIITTIIOONN__VVAALLIIDD flag RGBA color associated with current raster position Color index associated with current raster position Texture coordinates associated with current raster position GGLL__EEDDGGEE__FFLLAAGG flag

GGLL__DDEEPPTTHH__BBUUFFFFEERR__BBIITT GGLL__DDEEPPTTHH__TTEESSTT enable bit Depth buffer test function Depth buffer clear value GGLL__DDEEPPTTHH__WWRRIITTEEMMAASSKK enable bit

GGLL__EENNAABBLLEE__BBIITT GGLL__AALLPPHHAA__TTEESSTT flag GGLL__AAUUTTOO__NNOORRMMAALL flag GGLL__BBLLEENNDD flag Enable bits for the user-definable clipping planes GGLL__CCOOLLOORR__MMAATTEERRIIAALL GGLL__CCUULLLL__FFAACCEE flag GGLL__DDEEPPTTHH__TTEESSTT flag GGLL__DDIITTHHEERR flag GGLL__FFOOGG flag GGLL__LLIIGGHHTT_i where 0 <= _i GGLL__EEVVAALL__BBIITT GGLL__MMAAPP11___x enable bits, where _x is a map type GGLL__MMAAPP22___x enable bits, where _x is a map type 1D grid endpoints and divisions 2D grid endpoints and divisions GGLL__AAUUTTOO__NNOORRMMAALL enable bit

GGLL__FFOOGG__BBIITT GGLL__FFOOGG enable bit Fog color Fog density Linear fog start Linear fog end Fog index GGLL__FFOOGG__MMOODDEE value

GGLL__HHIINNTT__BBIITT GGLL__PPEERRSSPPEECCTTIIVVEE__CCOORRRREECCTTIIOONN__HHIINNTT setting GGLL__PPOOIINNTT__SSMMOOOOTTHH__HHIINNTT setting GGLL__LLIINNEE__SSMMOOOOTTHH__HHIINNTT setting GGLL__PPOOLLYYGGOONN__SSMMOOOOTTHH__HHIINNTT setting GGLL__FFOOGG__HHIINNTT setting

GGLL__LLIIGGHHTTIINNGG__BBIITT GGLL__CCOOLLOORR__MMAATTEERRIIAALL enable bit GGLL__CCOOLLOORR__MMAATTEERRIIAALL__FFAACCEE value Color material parameters that are tracking the current color Ambient scene color GGLL__LLIIGGHHTT__MMOODDEELL__LLOOCCAALL__VVIIEEWWEERR value GGLL__LLIIGGHHTT__MMOODDEELL__TTWWOO__SSIIDDEE setting GGLL__LLIIGGHHTTIINNGG 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 GGLL__SSHHAADDEE__MMOODDEELL setting

GGLL__LLIINNEE__BBIITT GGLL__LLIINNEE__SSMMOOOOTTHH flag GGLL__LLIINNEE__SSTTIIPPPPLLEE enable bit Line stipple pattern and repeat counter Line width

GGLL__LLIISSTT__BBIITT GGLL__LLIISSTT__BBAASSEE setting

GGLL__PPIIXXEELL__MMOODDEE__BBIITT GGLL__RREEDD__BBIIAASS and GGLL__RREEDD__SSCCAALLEE settings GGLL__GGRREEEENN__BBIIAASS and GGLL__GGRREEEENN__SSCCAALLEE values GGLL__BBLLUUEE__BBIIAASS and GGLL__BBLLUUEE__SSCCAALLEE GGLL__AALLPPHHAA__BBIIAASS and GGLL__AALLPPHHAA__SSCCAALLEE GGLL__DDEEPPTTHH__BBIIAASS and GGLL__DDEEPPTTHH__SSCCAALLEE GGLL__IINNDDEEXX__OOFFFFSSEETT and GGLL__IINNDDEEXX__SSHHIIFFTT values GGLL__MMAAPP__CCOOLLOORR and GGLL__MMAAPP__SSTTEENNCCIILL flags GGLL__ZZOOOOMM__XX and GGLL__ZZOOOOMM__YY factors GGLL__RREEAADD__BBUUFFFFEERR setting

GGLL__PPOOIINNTT__BBIITT GGLL__PPOOIINNTT__SSMMOOOOTTHH flag Point size

GGLL__PPOOLLYYGGOONN__BBIITT GGLL__CCUULLLL__FFAACCEE enable bit GGLL__CCUULLLL__FFAACCEE__MMOODDEE value GGLL__FFRROONNTT__FFAACCEE indicator GGLL__PPOOLLYYGGOONN__MMOODDEE setting GGLL__PPOOLLYYGGOONN__SSMMOOOOTTHH flag GGLL__PPOOLLYYGGOONN__SSTTIIPPPPLLEE enable bit GGLL__PPOOLLYYGGOONN__OOFFFFSSEETT__FFIILLLL flag GGLL__PPOOLLYYGGOONN__OOFFFFSSEETT__LLIINNEE flag GGLL__PPOOLLYYGGOONN__OOFFFFSSEETT__PPOOIINNTT flag GGLL__PPOOLLYYGGOONN__OOFFFFSSEETT__FFAACCTTOORR GGLL__PPOOLLYYGGOONN__OOFFFFSSEETT__UUNNIITTSS

GGLL__PPOOLLYYGGOONN__SSTTIIPPPPLLEE__BBIITT Polygon stipple image

GGLL__SSCCIISSSSOORR__BBIITT GGLL__SSCCIISSSSOORR__TTEESSTT flag Scissor box

GGLL__SSTTEENNCCIILL__BBUUFFFFEERR__BBIITT GGLL__SSTTEENNCCIILL__TTEESSTT 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

GGLL__TTEEXXTTUURREE__BBIITT 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 GGLL__TTEEXXTTUURREE__GGEENN___x, _x is S, T, R, and Q GGLL__TTEEXXTTUURREE__GGEENN__MMOODDEE setting for S, T, R, and Q ggllTTeexxGGeenn plane equations for S, T, R, and Q Current texture bindings (for example, GGLL__TTEEXXTTUURREE__BBIINNDDIINNGG__22DD)

GGLL__TTRRAANNSSFFOORRMM__BBIITT Coefficients of the six clipping planes Enable bits for the user-definable clipping planes GGLL__MMAATTRRIIXX__MMOODDEE value GGLL__NNOORRMMAALLIIZZEE flag GGLL__RREESSCCAALLEE__NNOORRMMAALL flag

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

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

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, render mode state, and select and feedback state cannot be saved. Client state must be saved with ggllPPuusshhCClliieennttAAttttrriibb.

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

When the GGLL__AARRBB__mmuullttiitteexxttuurree extension is supported, pushing and popping texture state apples to all supported texture units.

ERRORS

GGLL__SSTTAACCKK__OOVVEERRFFLLOOWW is generated if ggllPPuusshhAAttttrriibb is called while the attribute stack is full.

GGLL__SSTTAACCKK__UUNNDDEERRFFLLOOWW is generated if ggllPPooppAAttttrriibb is called while the attribute stack is empty.

GGLL__IINNVVAALLIIDD__OOPPEERRAATTIIOONN is generated if ggllPPuusshhAAttttrriibb or ggllPPooppAAttttrriibb is executed between the execution of ggllBBeeggiinn and the corresponding execution of ggllEEnndd.

ASSOCIATED GETS

ggllGGeett with argument GGLL__AATTTTRRIIBB__SSTTAACCKK__DDEEPPTTHH
ggllGGeett with argument GGLL__MMAAXX__AATTTTRRIIBB__SSTTAACCKK__DDEEPPTTHH

SEE ALSO

ggllGGeett((33GG)), ggllGGeettCClliippPPllaannee((33GG)), ggllGGeettEErrrroorr((33GG)), ggllGGeettLLiigghhtt((33GG)), ggllGGeettMMaapp((33GG)), ggllGGeettMMaatteerriiaall((33GG)),
ggllGGeettPPiixxeellMMaapp((33GG)), ggllGGeettPPoollyyggoonnSSttiippppllee((33GG)), ggllGGeettSSttrriinngg((33GG)), ggllGGeettTTeexxEEnnvv((33GG)), ggllGGeettTTeexxGGeenn((33GG)), ggllGGeettTTeexxIImmaaggee((33GG)), ggllGGeettTTeexxLLeevveellPPaarraammeetteerr((33GG)), ggllGGeettTTeexxPPaarraammeetteerr((33GG)), ggllIIssEEnnaabblleedd((33GG)), ggllPPuusshhCClliieennttAAttttrriibb((33GG))