I have a game that runs at 60 frames per second. I removed the frame rate limiting to see how fast it could run when the game is maximized (but not fullscreen) and i get 102 fps. When i press F4 (which switches it to fullscreen, but still the exact same resolution when its maximized) the fps drops to 45-48 fps.
Heres the log:
//Game first starts it runs at around 300+ fps
New resolution: 512x448
FPS: 105
FPS: 315
FPS: 279
FPS: 322
FPS: 324
//I press maximize button, game runs at 102 fps
New resolution: 1024x721
FPS: 275
FPS: 79
FPS: 102
FPS: 102
FPS: 101
FPS: 102
//I press F4 (to switch to fullscreen) fps drops to 45-48
New resolution: 1024x721
FPS: 79
FPS: 48
FPS: 49
FPS: 46
FPS: 47
And heres the "F4" code:
else if(keyCode == keyMap[SDLK_F4])
{
if(videoFlags & SDL_FULLSCREEN)
videoFlags &= ~SDL_FULLSCREEN;
else videoFlags |= SDL_FULLSCREEN;
resizeWindow(view.w, view.h, bpp, videoFlags);
}
and the resizeWindow()
bool CGame::resizeWindow(int width, int height, int bpp, int flags)
{
view.w = width;
view.h = height;
backBuffer = SDL_SetVideoMode(width, height, bpp, flags | SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_RESIZABLE);
targetBuffer = backBuffer;
return backBuffer != 0;
}
[Edited by - 39ster on April 16, 2008 3:08:27 AM]