[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] using opengl in pygame?



On Jun 20, 2004, at 10:50 PM, Jacob Schwartz wrote:

Hey,
A few years back I took a long hard look at using OpenGL/Direct3D to do my 2d graphics as opposed to using a more classical 2d library such as DirectDraw or SDL (or allegro). I ended up using Direct Draw (and now, pygame's SDL wrapper) for a few reasons, and I'm wondering how many (if any) of them are still valid.

If they are not valid, I may seriously consider switching to an OpenGL graphics layer for my next project. (Though, sadly my old notebook which I mostly develop on will not be able to run the app. Oh well, its not longer 1998.)
Actually, I have found that Mesa (the open source OpenGL clone) is generally fast enough for most OpenGL applications that don't require animated action. I have written 3 small internal applications where I used OpenGL via Mesa for 2D drawing capabilities. If you ever have to explicitly draw zooms, pans or clipping (eg. a map application), letting Mesa handle these transforms is dramatically faster than trying to do this stuff in Python.

It's also a *lot* easier to program pans and zooms by just changing an OpenGL matrix rather than having to handle all of the transform math yourself in Python.

-a