Error checking

By default, pyglet calls glGetError after every GL function call (except where such a check would be invalid). If an error is reported, pyglet raises GLException with the result of gluErrorString as the message.

This is very handy during development, as it catches common coding errors early on. However, it has a significant impact on performance, and is disabled when python is run with the -O option.

You can also disable this error check by setting the following option before importing or pyglet.window:

# Disable error checking for increased performance
pyglet.options['debug_gl'] = False

from import *

Setting the option after importing will have no effect. Once disabled, there is no error-checking overhead in each GL call.