standard C interface for OpenGL — Kivy 2.3.0 documentation (2024)

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_SDL2compile-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 when USE_SDL2=0. Requires kivy_deps.sdl2 be installed.

  • angle_sdl2 – Available on Windows with Python 3.5+.Unavailable when USE_SDL2=0. Requires kivy_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 when 1.

  • KIVY_GRAPHICS – Forces OpenGL ES2 when it is gles. 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=[])
standard C interface for OpenGL — Kivy 2.3.0 documentation (2024)
Top Articles
Latest Posts
Article information

Author: Greg O'Connell

Last Updated:

Views: 6163

Rating: 4.1 / 5 (62 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Greg O'Connell

Birthday: 1992-01-10

Address: Suite 517 2436 Jefferey Pass, Shanitaside, UT 27519

Phone: +2614651609714

Job: Education Developer

Hobby: Cooking, Gambling, Pottery, Shooting, Baseball, Singing, Snowboarding

Introduction: My name is Greg O'Connell, I am a delightful, colorful, talented, kind, lively, modern, tender person who loves writing and wants to share my knowledge and understanding with you.