make resizing of window when changing resolution smarter
This commit is contained in:
parent
8d8bf4af78
commit
f214984e18
1 changed files with 10 additions and 4 deletions
|
@ -267,10 +267,16 @@ void CVideo::ClearScreen()
|
|||
bool CVideo::ResizeScreen(int w, int h)
|
||||
{
|
||||
if (!(SDL_GetWindowFlags(TheWindow) & SDL_WINDOW_FULLSCREEN_DESKTOP)
|
||||
&& Video.Width == Video.WindowWidth
|
||||
&& Video.Height == Video.WindowHeight) {
|
||||
// if initially window was the same size as res, keep it that way
|
||||
SDL_SetWindowSize(TheWindow, w, h);
|
||||
&& Width == WindowWidth
|
||||
&& Height == WindowHeight) {
|
||||
// if initially window was the same size as res, keep it that way, unless we've resized
|
||||
int ww, wh;
|
||||
SDL_GetWindowSize(TheWindow, &ww, &wh);
|
||||
if (ww == Width && wh == Height) {
|
||||
WindowWidth = w;
|
||||
WindowHeight = h;
|
||||
SDL_SetWindowSize(TheWindow, w, h);
|
||||
}
|
||||
}
|
||||
Width = w;
|
||||
Height = h;
|
||||
|
|
Loading…
Add table
Reference in a new issue