Lamina is a tool to facilitate displaying SDL raster displays in OpenGL displays.

A Lamina object (there are a couple of different flavors… read the docstrings) has a surface attribute, and a display method.  Write to the surface attribute using any old pygame draw routine, or pass the surface attribute to your GUI library, refresh() it, and then call the display method from your OpenGL display code.

This version uses partial texture updates, only updating the areas within a ‘dirty rectangle’ list.   Pygame sprite functionality and GUIs return ‘dirty rectangle’ lists as part of their functionality.  These partial updates are faster than complete regenerations, and the demo folder includes a comparitive timing script.

This release also adds a demo (pyg_lam.py) with no ‘extra’ dependencies, no dependencies beyond python standard dist, pyopengl, and pygame.  You can try it out without installing a  GUI.

 http://cheeseshop.python.org/pypi/Lamina/0.2

Developed and tested with Python 2.4, Pygame 1.7, and PyOpenGL 2.0

About these ads