(svn r11734) -Change: Allow ToggleFullScreen to return the result of the operation' attempt. Previously, only visual clues were available.

-Fix[FS#1519]: When you can not use this resolution at full screen, now you'll know that it failed.
As for the reason it did not work, each computer/OS has its reason.
This commit is contained in:
belugas
2008-01-01 14:20:48 +00:00
parent a8611311ac
commit 3dd61f423a
15 changed files with 30 additions and 23 deletions

View File

@@ -521,14 +521,16 @@ bool VideoDriver_SDL::ChangeResolution(int w, int h)
return CreateMainSurface(w, h);
}
void VideoDriver_SDL::ToggleFullscreen(bool fullscreen)
bool VideoDriver_SDL::ToggleFullscreen(bool fullscreen)
{
_fullscreen = fullscreen;
GetVideoModes(); // get the list of available video modes
if (_num_resolutions == 0 || !this->ChangeResolution(_cur_resolution[0], _cur_resolution[1])) {
// switching resolution failed, put back full_screen to original status
_fullscreen ^= true;
return false;
}
return true;
}
#endif /* WITH_SDL */