vispy.gloo.gl package

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 http://www.khronos.org/opengles/sdk/docs/man/

class vispy.gloo.gl.MainProxy[source]

Bases: vispy.gloo.gl._proxy.BaseGLProxy

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(gloo.gl, funcname).

vispy.gloo.gl.check_error(when='periodic check')[source]

Check this from time to time to detect GL errors.

Parameters
whenstr

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

vispy.gloo.gl.make_debug_wrapper(fn)[source]
vispy.gloo.gl.use_gl(target='gl2')[source]

Let Vispy use the target OpenGL ES 2.0 implementation

Also see vispy.use().

Parameters
targetstr

The target GL backend to use.

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 gloo.gl (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)