[SDL] Blitting speeds

John Garrison jeg at visi.net
Fri Aug 27 03:05:14 PDT 1999


> Check to see if the screen surface is actually giving you double buffering.
> If not, the flip call is actually doing a full-screen update, which could
> limit your framerate to 20-40 FPS, depending on the speed of your system.

That was it, I replaced SDL_Flip with SDL_UpdateRects and got the same
framerate.  So I only updated the area that needed it with
SDL_UpdateRects and got 160fps. I have been wanting to implement a dirty
rectangles type routine for such an occasion, but that really wouldn't
help with a tiling engine that retiles the whole screen, I had my own
doublebuffer before I found out about SDL_Flip, but that was the same
slow speed, is there a speedy way to implement a double buffer? (maybe
one of the examples demonstrates this I don't know)

Anyway thanks for the help at least now I know what direction to go
about fixing it in :)
> 
> The testsprite program cheats a little by only updating the areas of the
> screen that have changed, so it's fast on both flipping and normal surfaces.
> 
>         -Sam Lantinga                           (slouken at devolution.com)
> 
> Lead Programmer, Loki Entertainment Software
> --
> "Any sufficiently advanced bug is indistinguishable from a feature"
>                                                  -- Rich Kulawiec



More information about the SDL mailing list