From ceadee1d756cda68bd49e0bd9e741c4b800a113e Mon Sep 17 00:00:00 2001 From: oy Date: Mon, 21 Dec 2015 11:37:59 +0100 Subject: [PATCH] fixed picking the correct default resolution --- src/engine/client/backend_sdl.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/engine/client/backend_sdl.cpp b/src/engine/client/backend_sdl.cpp index bad5927c8..940c2dc8d 100644 --- a/src/engine/client/backend_sdl.cpp +++ b/src/engine/client/backend_sdl.cpp @@ -667,6 +667,13 @@ int CGraphicsBackend_SDL_OpenGL::Init(const char *pName, int *Screen, int *pWidt *pDesktopWidth = DisplayMode.w; *pDesktopHeight = DisplayMode.h; + // use desktop resolution as default resolution + if (*pWidth == 0 || *pWidth == 0) + { + *pWidth = *pDesktopWidth; + *pHeight = *pDesktopHeight; + } + // set flags int SdlFlags = SDL_WINDOW_OPENGL; if(Flags&IGraphicsBackend::INITFLAG_RESIZABLE) @@ -679,7 +686,7 @@ int CGraphicsBackend_SDL_OpenGL::Init(const char *pName, int *Screen, int *pWidt *pWidth = *pDesktopWidth; *pHeight = *pDesktopHeight; #else - SdlFlags |= (*pWidth == 0 || *pHeight == 0) ? SDL_WINDOW_FULLSCREEN_DESKTOP : SDL_WINDOW_FULLSCREEN; // use desktop resolution as default + SdlFlags |= SDL_WINDOW_FULLSCREEN; #endif // set gl attributes