[SDL] SDL Performance once again

Torsten Giebl wizard at syntheticsw.com
Thu Sep 7 15:39:34 PDT 2006


Hello !


> I have read a couple of discussions on this topic but still haven't
> formed a consistent picture in my mind.
>
> The question is simple: suppose I initialize SDL, and perform a simple
> loop:
> Erase the whole screen
> Blit a background image
> Blit several sprites
> Pefrorm flip
>
>
> How many FPS should I get on a typical modern hardware (say, 1,5 GHz
> processor and a decent videocard; 1024*768*32b) under reasonable
> assumptions?
>
> I know it depends on hardware/software surfaces, fullscreen/windowed
> mode, etc., but still? In my case it is usually 70-80 FPS, no more (while
> I
> expected at least 150).
>
> One reply in the newsgroup was something like: "if you want to get speed
> in SDL, you should use OpenGL, otherwise you execute a generic
> cross-platform (slow) code". Is it really so? I mean if I want speed, I
> should forget about all SDL functions for blitting and about third-party
> routines for primitives (like SDL_prim), and begin to study OpenGL?


You can get good speeds if you use HW Surfaces and
DGA on Linux/X11 or DirectX on Windows. When these
things are supported on your system. Another thing
if you want to have Alpha Blending use SW Surfaces
when not using OpenGL as Alpha Blending needs read&write
of pixels which is the fastest in system memory.


CU






More information about the SDL mailing list