[SDL] SDL Performance once again
darkmatter at freeuk.com
Fri Sep 8 06:56:09 PDT 2006
Thursday, September 7, 2006, 5:13:29 PM, you wrote:
> Hello everybody,
> I have read a couple of discussions on this topic but still haven't formed a
> consistent picture in my mind.
> 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).
What platform and what backend?
> 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?
It all depends on the backend. Under Windows, if a blit can be done in
hardware (ie, if the DirectX backend is used, if the source and dest
formats are the same, and if the surfaces are in video memory) then a
hardware blit is done. If the blit involves format conversion,
software routines are used. On some backends, software is always used.
Saying "Use OpenGL" is a knee jerk thing. It depends what you want to
do. If you want to do lots of scaled blits, GL is better. If you want alpha
transparency, GL is better. If what you're blitting is dynamically
changing often, GL is a pain. GL is also only any good if you assume
that the user will have a hardware accelerated GL implementation. If
they don#t, the software GL will be much slower than any software
based 2d blitters.
Peter mailto:darkmatter at freeuk.com
More information about the SDL