fdkz / libcopengl

a very limited but fast opengl wrapper for python. wraps parts of the fixed-function pipeline.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

libcopengl

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.

Implementation idea

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.

Using

from copengl import *
and also look at the example.py file.

Installing

There are three possibilities:

  • Copy ./copengl to your own project.
  • git clone to your own project as a submodule and modify sys.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.

Building

The ./copengl directory should already contain everything prebuilt. But the cython modules can be compiled by following instructions in modules_src/.

About

a very limited but fast opengl wrapper for python. wraps parts of the fixed-function pipeline.

License:MIT License


Languages

Language:Python 52.4%Language:C 47.4%Language:C++ 0.2%