[SDL] SDL_Flip causes a HUGE loss of fps!
derethor at thepentagon.com
Fri Jan 5 01:50:13 PST 2001
When I update the screen in fullscreen mode, I have a quite normal loop
surface = SDL_GetVideoSurface ();
if (!surface) return;
if ( DK_SURFACE_IS_OPENGL (surface) )
Let's talk about the non-opengl surface...
without the SDL_Flip (surface); I have ~33500 fps doing nothing else
but waiting a key (640x480 32bpp, Athlon 650 under linux)
with that call, the frame rate goes down to ~118 fps !!
is this normal?
FYI, I create the surface with this code
sdl_flags |= SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN;
if ( SDL_VideoModeOK (surface_old->w, surface_old->h, 32, sdl_flags) )
fullscreen = SDL_SetVideoMode ( surface_old->w, surface_old->h, 32,
DK_ERROR ("Unable to set the fullscreen: %s", SDL_GetError() );
DK_ERROR ("requested fullscreen video mode is not supported");
but at this point, neither SDL_HWSURFACE and SDL_DOUBLEBUF are active
on the fullscreen surface :?
I get the videomodes like this:
modes = SDL_ListModes (NULL, SDL_FULLSCREEN | SDL_HWSURFACE |
thanks ins advance!
derethor of centolos
More information about the SDL