Registry / ai-ml / pyopengl-accelerate

pyopengl-accelerate

JSON →
library3.1.10pypypi✓ verified 25d ago

PyOpenGL-accelerate is a collection of Cython-coded extensions designed to optimize common, performance-critical operations within PyOpenGL 3.x. While not strictly required for PyOpenGL functionality, its installation is highly recommended to achieve improved rendering speeds, particularly when dealing with large arrays of data. It is maintained as an integral part of the broader PyOpenGL project. The current version is 3.1.10, with releases typically synchronized with the main PyOpenGL library.

pip install PyOpenGL PyOpenGL-accelerate
INSTALL
IMPORT
SIG · PYOPENGL-ACCELERAT
P
pyopengl-accelerate
ai-mlpythonv3.1.10
Install
3.5s avg
Import
—
Disk
56MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v3.1.10 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 55.4MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 3.5s · import 0.000s · 59MB
56MB installed
● package 56MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

OpenGL_accelerate
✓ import OpenGL_accelerate # Rarely explicitly imported, works implicitly
PyOpenGL-accelerate generally works by transparently patching PyOpenGL internals. Direct import is usually not necessary for its benefits, but might be used for specific low-level access or debugging.

PyOpenGL-accelerate transparently enhances the performance of PyOpenGL code when installed. This quickstart demonstrates a basic rotating 3D cube using PyOpenGL with Pygame, where PyOpenGL-accelerate would provide underlying performance improvements without requiring explicit calls.

import pygame from pygame.locals import * from OpenGL.GL import * from OpenGL.GLU import * def draw_cube(): vertices = ( (1, -1, -1), (1, 1, -1), (-1, 1, -1), (-1, -1, -1), (1, -1, 1), (1, 1, 1), (-1, -1, 1), (-1, 1, 1) ) edges = ( (0,1), (0,3), (0,4), (2,1), (2,3), (2,7), (6,3), (6,4), (6,7), (5,1), (5,4), (5,7) ) glBegin(GL_LINES) for edge in edges: for vertex in edge: glVertex3fv(vertices[vertex]) glEnd() def main(): pygame.init() display = (800, 600) pygame.display.set_mode(display, DOUBLEBUF | OPENGL) gluPerspective(45, (display[0] / display[1]), 0.1, 50.0) glTranslatef(0.0, 0.0, -5) while True: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() return glRotatef(1, 3, 1, 1) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) draw_cube() pygame.display.flip() pygame.time.wait(10) if __name__ == '__main__': main()
Debug
Known issues
gotchaPyOpenGL-accelerate is not a silver bullet for all performance issues. It primarily optimizes specific 'slow points' in PyOpenGL 3.x, particularly for array-based operations. Older, less performant OpenGL patterns (like immediate mode with `glBegin`/`glEnd`) will not see significant benefits.
fix
Focus on modern OpenGL techniques (e.g., Vertex Buffer Objects/VBOs) for significant performance gains, which PyOpenGL-accelerate can then further optimize.
affects: All versions
gotchaPyOpenGL-accelerate typically works by transparently patching PyOpenGL internals. Users should not expect to import symbols directly from `OpenGL_accelerate` for most common usage, as its benefits are applied implicitly to PyOpenGL calls.
fix
Simply install `PyOpenGL-accelerate` alongside `PyOpenGL`. Your existing PyOpenGL code will be accelerated automatically where applicable.
affects: All versions
breakingInstallation issues related to C compiler availability or specific Python/Cython versions are common, especially on platforms without pre-built wheels. This can lead to compilation errors during `pip install`.
fix
Ensure a compatible C compiler (e.g., GCC on Linux, MSVC on Windows) is installed and configured in your system's PATH. Consider installing `Cython` explicitly if building from source. Look for pre-built wheels (`.whl` files) for your specific Python version and OS if `pip install` fails.
affects: All versions, particularly with newer Python releases or non-standard environments.
gotchaThere have been reports of `TypeError`s or other runtime issues when using mismatched versions of `PyOpenGL` and `PyOpenGL-accelerate`. While often compatible, specific combinations can cause problems.
fix
Whenever possible, install both `PyOpenGL` and `PyOpenGL-accelerate` simultaneously using `pip install PyOpenGL PyOpenGL-accelerate` to ensure compatible versions are chosen by the package resolver. If issues persist, try a slightly older, stable pair of versions.
affects: Potentially all versions, especially when manually selecting versions.
Upgrade
Version history
3.1.10latest on PyPI · released Aug 18, 2025
Audit
Dependencies
PyOpenGLrequiredPyOpenGL-accelerate provides performance enhancements for PyOpenGL; it does not function independently.
CythonoptionalRequired for building from source if pre-compiled wheels are not available for your platform/Python version.
C compileroptionalRequired for building the Cython extensions from source.
Agent activity
52 hits · last 30 days
node
46
OpenAI (training)
2
Resources
pyopengl-accelerate — pip install pyopengl-accelerate · libregistry