A very limited but fast opengl wrapper for python. Wraps parts of the legacy
fixed-function pipeline. Sorry, no benchmarks, but for simple opengl use it's
much faster than either PyOpenGL or the pyglet opengl wrapper. As to what
functions are wrapped and what not - you'll have to check it yourself from the
generated copengl.pyx
file.
Use a part of glew.h
(here named opengl_preprocess.h
) from The OpenGL
Extension Wrangler Library to generate most of the cython opengl
wrapper functions, but override some of the autogenerated wrappers with
functions from handmadewrappers.pyx
because automatic generation doesn't
work for functions that have pointers in parameters or return values.
from copengl import *
and also look at the example.py
file.
There are three possibilities:
- Copy
./copengl
to your own project. git clone
to your own project as a submodule and modifysys.path
at program startup.python setup.py install
Note that the ./copengl
directory contains (if maintained..) binaries for
all supported platforms (macosx universal, windows64, linux32/64). Enjoy the
fact that your program will run on every platform by just being simply copied!
The third setup.py install
(and also setup.py build
) method will
copy only the platform-specific binaries. Generating redistributable wheels
will do the same, but the metadata has no indication that the wheel
is
platform-specific.
Finding out how to fiddle with binary distributions and wheels, sporks, eggs, hatchlings, pip, setuptools, distutils, .. good luck.
The ./copengl
directory should already contain everything prebuilt. But the
cython modules can be compiled by following instructions in modules_src/
.