[SDL] Re: Colorful Mousecursrors with SDL

David Olofson david at olofson.net
Thu Jan 27 10:26:44 PST 2005

On Thursday 27 January 2005 16.55, Sebastian Beschke wrote:
> Hi,
> In the case of a scrolling background, the easiest and most 
> solution is usually to repaint the whole screen each frame.

Yep. Simple, robust, portable, no problems with unusual buffering 
implementations etc.

> For the few cases where it isn't, there is a technique called "Dirty 
> rects", which you might try googling for. But it's a whole lot more 
> complicated than just repainting everything, and usually not worth
> the  effort.

I'd say it's *definitely* worth the effort (at least if you care one 
bit about smooth animation), unless you have a constantly scrolling 

Without h/w acceleration, frame rates quickly drop way below 50 FPS 
with 24 or 32 bit color and 800x600+ resolutions - but unless you 
have an extremely crowded screen (tons of sprites), you can up that 
to the hundreds or thousands range, pretty much regardless of 
resolution and video backend.

(Of course, this is "free-running" FPS! If you can get retrace sync'ed 
page flipping, you should use it whenever you're not benchmarking.)

Have a look at Fixed Rate Pig:

 Site: http://olofson.net/examples.html
 Direct: http://olofson.net/download/pig-1.0.tar.gz

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
|  Free/Open Source audio engine for games and multimedia.  |
| MIDI, modular synthesis, real time effects, scripting,... |
`-----------------------------------> http://audiality.org -'
   --- http://olofson.net --- http://www.reologica.se ---

More information about the SDL mailing list