function to get entire opengl state?

I’d like to be able to dump every state in opengl to debug a program, so I can do a diff on 2 dumps where one program works and the other one doesn’t.

I can’t find such a function in opengl. I could write one that calls glGets about 350 times, etc, but it would take a long time. Does one already exist?


Not that i know, unfortunately.


Try to use glIntercept (google for it). It can dump whole frame in HTML file with screengrabs befora and after each draw call.

What’s your purpose? Is it for debugging? If so you can use external OpenGL debugging tools. On Linux, I use BuGLe. It has a command line executable as well as a GUI. In the GUI you can listen to states that have changed since the last GL breakpoint (so an OpenGL state diff, as it looks it is what you want). On Mac, I use the OpenGL profiler tool, it can track state change as well.

There are tools that allow to do that.
glIntercept :
BuGLe :
and gDEBugger (commercial license) :

EDIT: oops, was a bit slow :slight_smile: