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

Re: [pygame] PyGame / PyOpenGL Example



Brian Fisher wrote:
On Feb 13, 2008 3:43 PM, René Dudfield <renesd@xxxxxxxxx> wrote:

Have you seen the Lamina code?
http://pitchersduel.python-hosting.com/browser/branches/Lamina/

I would guess that it would perform poorly if you
wanted a lot of moving/animating pygame surfaces drawn all over.

You don't have to redraw the whole overlay -- you can just
update selected parts of the texture and redraw those, e.g.
the bounding rectangles of your sprites.

Also,
it appears to take the approach of putting the overlay into a subset
of a power of 2 texture.

I don't see much disadvantage in that, other than perhaps
wasting a bit of video memory. The unused parts of the
texture are never touched once the texture has been set
up.

And if you're clever, you may find something useful to
pack into the otherwise unused areas.

It's probably not the best in all cases, but the Lamina
approach has the advantage that it's very simple and
requires little modification of the techniques one
uses in normal 2D pygame apps. So it's often possible
to use one of the existing pygame gui libraries with
it almost unchanged.

--
Greg