Tuesday, September 12, 2006

BlitScheduler - a new approach to using pygame with Kamaelia

Structure for blitting (using any 2d graphics library, but initially pygame):
- BlitScheduler component (which subclasses Scheduler) controls a single surface
- Visual components (e.g. line, sprite) are activated with a BlitScheduler component
- For each frame/refresh of the screen, BlitScheduler follows the following procedure:

1. Sort the visual components associated with it by z-order (so the backmost is first).
2. Send a message to the blit inbox of every visual component containing a reference to the shared surface (controlled by that BS)
3. Run the generator of each visual component in turn (by z-order)
4. Flip the surface (updating it to show the newly rendered surface).

Labels:

1 Comments:

Blogger Michael said...

Sounds good. Sounds very much like the cleaned up plans I had for the sprite scheduler. Hope it works out :-)

6:57 PM  

Post a Comment

<< Home