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

Re: [pygame] Double Buffered display vs Overlays



On Thu, 2005-09-15 at 20:28 +0100, Michael Sparks wrote:
> I'm currently decoding and displaying video in a pygame overlay. I also
> have a bunch of surfaces I regularly blit into the display surface.

A common technique is to set the Movie object to display to an offscreen
Surface. Then, every time you are drawing a frame you blit the offscreen
onto the display Surface. As long as your screen framerate is keeping up
with the movie you won't be missing any frames.

This technique does take a bit more processing than just playing to the
Overlays. I'd do a bunch of speed testing for anything larger like DVD
resolution.

The bonus for the offscreen Movie Surface is that you can draw things on
top of the movie. It gets blitted to the screen like any other Surface.