Is there any way I can set a symbolic breakpoint that will trigger when any OpenGL function call sets any state other than GL_NO_ERROR? Initial evidence suggests opengl_error_break is intended to to serve just that purpose, but it doesn’t break.
Is there any way I can set a symbolic breakpoint that will trigger when
Share
Based on Lars’ approach you can achieve this tracking of errors automatically, it is based on some preprocessor magic and generating stub functions.
I wrote a small Python script which processes the OpenGL header (I used the Mac OS X one in the example, but it should also work with the one of iOS).
The Python script generates two files, a header to include in your project everywhere where you call OpenGL like this (you can name the header however you want):
The header contains macros and function declarations after this scheme:
The script also produces a source file in the same stream which you should save separately, compile and link with your project.
This will then wrap all
gl*functions in another function which is prefixed with_gl_debug_error_which then checks for errors similar to this: