Debugging OpenGL

The graphics_vbo option enables the use of vertex buffer objects in pyglet.graphics (instead, only vertex arrays). This is useful when debugging the graphics module as well as isolating code for determining if a video driver is faulty.

The debug_graphics_batch option causes all Batch objects to dump their rendering tree to standard output before drawing, after any change (so two drawings of the same tree will only dump once). This is useful to debug applications making use of Group and Batch rendering.

Error checking

The debug_gl option intercepts most OpenGL calls and calls glGetError afterwards (it only does this where such a call would be legal). If an error is reported, an exception is raised immediately.

This option is enabled by default unless the -O flag (optimisation) is given to Python, or the script is running from within a py2exe or py2app package.

Tracing

The debug_gl_trace option causes all OpenGL functions called to be dumped to standard out. When combined with debug_gl_trace_args, the arguments given to each function are also printed (they are abbreviated if necessary to avoid dumping large amounts of buffer data).