Module contents

This module provides a (functional) API to OpenGL ES 2.0.

There are multiple backend implementations of this API, available as submodules of this module. One can use one of the backends directly, or call gl.use_gl() to select one. The backend system allow running visualizations using Angle, WebGL, or other forms of remote rendering. This is in part possible by the widespread availability of OpenGL ES 2.0.

All functions that this API provides accept and return Python arguments (no ctypes is required); strings are real strings and you can pass data as numpy arrays. In general the input arguments are not checked (for performance reasons). Each function results in exactly one OpenGL API call, except when using the pyopengl backend.

The functions do not have docstrings, but most IDE’s should provide you with the function signature. For more documentation see



Main proxy for the GL ES 2.0 API.

The functions in this namespace always call into the correct GL backend. Therefore these function objects can be safely stored for reuse. However, for efficienty it would probably be better to store the function name and then do func = getattr(, funcname).'periodic check')

Check this from time to time to detect GL errors.


Shown in the exception to help the developer determine when this check was done.*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)*args)

Let Vispy use the target OpenGL ES 2.0 implementation

Also see vispy.use().


The target GL backend to use. Default gl2 or es2, depending on the platform.

Available backends:
* gl2 - Use ES 2.0 subset of desktop (i.e. normal) OpenGL
* gl+ - Use the desktop ES 2.0 subset plus all non-deprecated GL

functions on your system (requires PyOpenGL)

* es2 - Use the ES2 library (Angle/DirectX on Windows)
* pyopengl2 - Use ES 2.0 subset of pyopengl (for fallback and testing)
* dummy - Prevent usage of (for when rendering occurs elsewhere)
You can use vispy’s config option “gl_debug” to check for errors
on each API call. Or, one can specify it as the target, e.g. “gl2
debug”. (Debug does not apply to ‘gl+’, since PyOpenGL has its own
debug mechanism)