[SDL] Newbie question about blitting
Sam Lantinga
slouken at devolution.com
Sat Jul 26 12:42:01 PDT 2003
> Hi there....
> i'm new to SDL and spent a weekend so far figuring out how everything
> is working. I've started with some speed-tests today and ran across
> some strange behaviors (ok, i didn't went through the complete SDK
> sources, maybe it's already explained there :-) )
> Each frame I do a simple fullscreen blit from a backbuffer to the
> double-buffered main-surface, calculate the frame rate, draw a short
> string (~20 blits, no Alpha or ColorKey), doing a flip.
> In fullscreen, everything is working fine, framerate is up to 85fps
> and profiler shows a cpu-load which is equivalent to DirectX.
> When testing in windowed-mode, framerate drops to 14-18fps?? Profiler
> shows that all cpu-time is used by the SDL_Flip function.
> All surfaces are converted to displayFormat, so there shouldn't be any
> trouble blitting the data.
Actually, make sure you're using 0 as the bit depth in windowed mode,
as it will pick the depth used by the windowing system, if you don't
care what pixel format you'll get. I'm guessing you're specifying a
depth of 24, which is actually a 3-byte pixel format and is the slowest
to convert to the screen depth.
See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment
More information about the SDL
mailing list