Hi,
I am trying to make an SDL window resizable, however, whenever I stretch the width, the height seems to randomly increase on its own. If I verify the resulting height value in resizeWindow its usually a number with more than 6 digits.
Even if I "diagonally stretch" the window the result is the same. This does not happen if I only stretch the height.
The event code:
case SDL_VIDEORESIZE:
engine.graphics->resizeWindow(event.resize.w, event.resize.h);
engine.screenW = engine.graphics->getScreenW();
engine.screenH = engine.graphics->getScreenH();
resetWindowDependantValues();
break;
As a side question: is it better to let the user drag&drop to a desired size and use that resolution when he goes fullscreen or limit the fullscreen resolutions to a set list (800x600, 1024x768, etc)?
Also, I had a question about the resizing of the window itself. Is it possible to *test* the selected window settings? For example:
SDL_Surface* tempScreen;
tempScreen = SDL_SetVideoMode(screenW, screenH, screenBPP, SDL_HWSURFACE|SDL_DOUBLEBUF|SDL_RESIZABLE|SDL_FULLSCREEN);
if(tempScreen) screen = tempScreen;
That won't work since doing SetVideoMode would release the old screen value possibly leaving the application without a valid screen. Is the only way to do this storing the working settings and reinitializing in case the new settings don't work?
[Edited by - Bahdom on January 26, 2009 1:12:07 PM]