Implementation of OpenGL errors/exceptions
Note that OpenGL-ctypes will also throw standard errors, such as TypeError or ValueError when appropriate.
ErrorChecker is an _ErrorChecker instance that allows you to register a new error-checking function for use throughout the system.


Raised to indicate that operation requires data-copying
if you set: OpenGL.ERROR_ON_COPY = True
before importing OpenGL.GL, this error will be raised when a passed argument would require a copy to be made.
class Error( Exception ):
Base class for all PyOpenGL-specific exception classes
class GLError( Error ):
OpenGL core error implementation class
Primary purpose of this error class is to allow for annotating an error with more details about the calling environment so that it's easier to debug errors in the wrapping process.
the OpenGL error code for the error
the OpenGL result code for the operation
the "function" being called
the translated set of Python arguments
the Python objects matching 1:1 the C arguments
ctypes-level arguments to the operation, often raw integers for pointers and the like
OpenGL description of the error (textual)
GLU error implementation class
class GLUTError( Error ):
GLUT error implementation class
class NoContext( Error ):
Raised to indicate that there is no currently active context
Technically almost *any* OpenGL call can segfault if there is no active context. The OpenGL.CHECK_CONTEXT flag, if enabled will cause this error to be raised whenever a GL or GLU call is issued (via PyOpenGL) if there is no currently valid context.
Error raised when an undefined function is called