[SDL] Incremental updates and hardware/double buffered surfaces

David Olofson david at olofson.net
Wed Aug 24 05:33:49 PDT 2005


On Wednesday 24 August 2005 06.30, Sam Lantinga wrote:
> > Problem is, when I switch to fullscreen mode, the screen flickers
> > because the next update is a dirty update.  The only way I've been
> > able to fix it is basically force a full update each frame,
> > eliminating the incremental/dirty update code.  But in this case,
> > now performance drops again.  Is there a way of combining
> > incremental updates with hardware/double-buffered surfaces in such
> > as way that I don't have to redraw the whole frame every frame?      
> 
> It's pretty simple, you just have to maintain two dirty lists, one
> for each back buffer.  There are some pretty good descriptions on
> the mailing list if you use the search option at www.libsdl.org

My Pig example/game includes this feature, along with a small "engine" 
that combines dirty rectangles for efficiency - though it's not 
exactly a simple, minimal example. ;-)

	http://olofson.net/examples.html


//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