Which Sdl Flags Should Be Used For Optimal Performence?


yaustar

UK GP32 & GP2X Owner
Joined
Oct 18, 2003
Messages
2,714
Location
UK
Website
Visit site
.. and if possible, why?
Currently I am using:
Code:
const unsigned int DEFAULT_VIDEO_MODE = (SDL_HWSURFACE | SDL_HWPALETTE | SDL_DOUBLEBUF);
 
I didnt see any speed difference beetwen SDL_SWSURFACE & SDL_HWSURFACE.
I didnt use SDL_HWPALETTE

SDL_DOUBLEBUF synchronise your buffer switch with screen refresh if you used SDL_Flip(lcd);
PB the speed change with the LCD setting :-/
 
SDL_HWSURFACE makes sure your surface is stored in the video RAM. SW and HW surface are blitted with the hardware blitter if you're using Paeryn's SDL. But the blitter is faster if its going from video RAM to video RAM.

SDL_HWPALLETE only works if you're in 8bpp mode.

Heres a tip: Instead of using SDL_Flip(screen) and the SDL_DOUBLEBUF flag, use SDL_UpdateRects to update only the parts of the screen you have changed (unless you're program changes the entire screen every frame).
 
Back
Top