Hi,
How about a new command called glReset(GLenum param) which would reset all or part of the state machine to the “default” values (the initial state).
For instance, lights could be set to their original position and colors by calling :
glReset(GL_LIGHT);
or maybe :
glResetAttrib(GL_LIGHTING_BIT);
The latter would allow to perform a multiple reset in one command thanks to an OR’ed argument.
glResetAttrib(GL_LIGHTING_BIT|GL_FOG_BIT|GL_VIEWPORT_BIT);
The set of “resetable” parameters could be associated to the equivalent attrib bits of glPushAttrib. This way there would be an orthogonality between glPushAttrib/glPopAttrib/glResetAttrib a bit like in glPushMatrix/glPopMatrix/glLoadIdentity