PyOpenGL -- The Python OpenGL Binding (original) (raw)
About PyOpenGL
PyOpenGL is the most common cross platform Python binding to OpenGL and related APIs. The binding is created using the standard ctypes library, and is provided under an extremely liberal BSD-style Open-Source license.
PyOpenGL Supports
- OpenGL v1.1 to 4.4
- GLES 1 to 3.1 (Experimental)
- GLU
- EGL, WGL, GLX
- GLUT, FreeGLUT
- GLE 3 (GL Extrusion Library)
- hundreds of extensions to GL, GLES, EGL, WGL and GLX
PyOpenGL is interoperable with a large number of external GUI libraries for Python including (but not limited to):
- wxPython
- PyGame
- PyQt and PySide
- PyGTK
- Raw XLib
- OSMesa
- Raspberry Pi BCM
- Tkinter (if you have installed the Togl widget for Tk)
PyOpenGL 3.x runs on:
- Python 3.3+ (3.2 support is likely to work, but untested)
- Python 2.7 (recommended)
- Python 2.6 (for compatibility with older software and systems)
- PyPy (experimental)
Sub-Packages
The PyOpenGL project includes a number of sub-projects:
- PyOpenGL, the "OpenGL" package when installed, provides GL, GLES1, GLES2, GLES3, GLUT, GLU, GLE, WGL, EGL and GLX subpackages
- OpenGL_accelerate, a cython coded accelerator module for PyOpenGL, optional, but recommended where available
- The code for OpenGL_accelerate is in the core PyOpenGL repository, but is distributed as a separate Python package and installs as OpenGL_accelerate
- PyOpenGL-Demo, a collection of small stand-alone demos
- You normally want to run these from the source distribution, as there's nothing installed by the package
- OpenGLContext, a teaching and testing library built on top of PyOpenGL (and a lot of other libraries)
- You do NOT need OpenGLContext to use PyOpenGL
Downloading and Installation
The easiest way to install PyOpenGL is using pip
$ pip install PyOpenGL PyOpenGL_accelerate
You can also manually download the packages:
unpack them into temporary directories, change to those directories and run:
python setup.py
Detailed installation instructions are available.
Documentation
The documentation collection provides reference documentation, support and feedback information and pointers to more in-depth documentation.
Source Code
You can work with latest version of PyOpenGL using the bzr distributed source code control tool on the LaunchPad code-hosting platform:
bzr branch lp:pyopengl
bzr branch lp:pyopengl-demo
bzr branch lp:openglcontext
Contributions and patches are very welcome. You can either request a merge via LaunchPad or send a patch-set via email using "bzr send" to mcfletch@vrplumber.com.
Support
Bugs and general questions are best reported and answered on the PyOpenGL mailing list. The list is fairly low-traffic.
Other Libraries
There are quite a few 3D-related libraries available for use with Python, many of them either based on, or extensible with PyOpenGL. PyOpenGL's author collects pointers to them on his site. There is another commonly used binding of OpenGL for Python which is part of the Pyglet game development environment.