Table Of Contents
- CGL: standard C interface for OpenGL
- cgl_get_backend_name()
- cgl_get_initialized_backend_name()
- cgl_init()
Kivy uses OpenGL and therefore requires a backend that provides it.The backend used is controlled through the USE_OPENGL_MOCK
and USE_SDL2
compile-time variables and through the KIVY_GL_BACKEND
runtimeenvironmental variable.
Currently, OpenGL is used through direct linking (gl/glew), sdl2,or by mocking it. Setting USE_OPENGL_MOCK
disables gl/glew.Similarly, setting USE_SDL2
to 0
will disable sdl2. Mockingis always available.
At runtime the following backends are available and can be set usingKIVY_GL_BACKEND
:
gl
– Available on unix (the default backend). Unavailable whenUSE_OPENGL_MOCK=0
. Requires gl be installed.glew
– Available on Windows (the default backend). Unavailable whenUSE_OPENGL_MOCK=0
. Requires glew be installed.sdl2
– Available on Windows/unix (the default when gl/glew is disabled).Unavailable whenUSE_SDL2=0
. Requireskivy_deps.sdl2
be installed.angle_sdl2
– Available on Windows with Python 3.5+.Unavailable whenUSE_SDL2=0
. Requireskivy_deps.sdl2
andkivy_deps.angle
be installed.mock
– Always available. Doesn’t actually do anything.
Additionally, the following environmental runtime variables control the graphicssystem:
KIVY_GL_DEBUG
– Logs al gl calls when1
.KIVY_GRAPHICS
– Forces OpenGL ES2 when it isgles
. OpenGL ES2 is alwaysused on the android, ios, rpi, and mali OSs.
- kivy.graphics.cgl.cgl_get_backend_name(allowed=[], ignored=[])¶
- kivy.graphics.cgl.cgl_get_initialized_backend_name()¶
- kivy.graphics.cgl.cgl_init(allowed=[], ignored=[])¶