Reset all states


is there a way to reset all the states (lighting, texturing, depth testing, …) to there default values in a simple way?


when you’ve made the context current for the first time, call glPushAttrib(GL_ALL_ATTRIB_BITS). this will save all attributes.

afterwards, you can call glPopAttrib to restore the default states.