Hi!
Is there a way to set all state variables to their initial values with one command? I want to avoid to set GL_LINE_WIDTH, GL_FOG, GL_LINE_SMOOTH, GL_LINE_STIPPLE_PATTERN, GL_FRONT_FACE and so on manually…
Thanks!
Johannes
Hi!
Is there a way to set all state variables to their initial values with one command? I want to avoid to set GL_LINE_WIDTH, GL_FOG, GL_LINE_SMOOTH, GL_LINE_STIPPLE_PATTERN, GL_FRONT_FACE and so on manually…
Thanks!
Johannes
Hi,
Little extract from the Red Book : (look at it to find the different group you need)
void glPushAttrib(GLbitfield mask);
void glPopAttrib(void);
glPushAttrib() saves all the attributes indicated by bits in mask by pushing them onto the attribute stack. glPopAttrib() restores the values of
those state variables that were saved with the last glPushAttrib(). Table 2-7 lists the possible mask bits that can be logically ORed together to
save any combination of attributes. Each bit corresponds to a collection of individual state variables. For example, GL_LIGHTING_BIT
refers to all the state variables related to lighting, which include the current material color, the ambient, diffuse, specular, and emitted light,
a list of the lights that are enabled, and the directions of the spotlights. When glPopAttrib() is called, all those variables are restored.
PS : you’ll have the same with glPopAttrib…