Save/Load GL Settings

Hello,
I have some different effects in one application.
Each effect needs different GL settings like glEnable(GL_LIGHTING), glEnable(GL_BLEND) and so on…

Before I start an effect, I would like to save all current GL settings and reload them after the effect is finished.

Now i have two functions like:

setupSettingsForMe(){ glEnable(something) }

and

setupSettingsForThem() { glDisable(something) }

Hi,

If you are using same rendering context, then you can use
glPushAttrib() and glPopAttrib() to save all settings.
The special mask GL_ALL_ATTRIB_BITS can be used to save all stackable states.

If rendering contexts are different, then need to call glGet() for each changeable attribute and save. Then call glGet.