Skip to main content
`Ctrl`+`K`

# vispy.gloo.gl package

## Subpackages

- vispy.gloo.gl.tests package
  - Submodules
    - vispy.gloo.gl.tests.test_basics module
    - vispy.gloo.gl.tests.test_functionality module
    - vispy.gloo.gl.tests.test_names module
    - vispy.gloo.gl.tests.test_use module
  - Module contents

## Submodules

- vispy.gloo.gl.dummy module
  - `DummyProxy`
- vispy.gloo.gl.es2 module
- vispy.gloo.gl.gl2 module
- vispy.gloo.gl.glplus module
- vispy.gloo.gl.pyopengl2 module

## 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

  Bases: `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')

  Check this from time to time to detect GL errors.

  Parameters:
    when str

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

vispy.gloo.gl.make_debug_wrapper(fn)

vispy.gloo.gl.use_gl(target=None)

  Let Vispy use the target OpenGL ES 2.0 implementation

  Also see `vispy.use()`.

  Parameters:
    target str

      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 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)