Hi,

I have some OpenGL rendering code (VBO + textures + shaders) which I need to integrate in a client rendering framework.

To avoid any OpenGL state change from the client rendering framework point of view, I try to push / pop all my modifications :

void draw()
{
pushState();

glBind...
glBind...
glEnable...
glDraw...

popState();
}

Before OpenGL 3, I used method like "glPushClientAttrib". What is the "modern" way to do that ? Should I execute a bunch of glGet / glSet ?

And is there any way to restore all OpenGL state to its "default" state ? The idea is to ensure my glDraw call is made with correct state :

void draw()
{
pushState();
resetState();

glBind...
glBind...
glEnable...
glDraw...

popState();
}


Thanks !