mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
fixed picking the correct default resolution
This commit is contained in:
parent
bd14ce2a1b
commit
ceadee1d75
|
@ -667,6 +667,13 @@ int CGraphicsBackend_SDL_OpenGL::Init(const char *pName, int *Screen, int *pWidt
|
||||||
*pDesktopWidth = DisplayMode.w;
|
*pDesktopWidth = DisplayMode.w;
|
||||||
*pDesktopHeight = DisplayMode.h;
|
*pDesktopHeight = DisplayMode.h;
|
||||||
|
|
||||||
|
// use desktop resolution as default resolution
|
||||||
|
if (*pWidth == 0 || *pWidth == 0)
|
||||||
|
{
|
||||||
|
*pWidth = *pDesktopWidth;
|
||||||
|
*pHeight = *pDesktopHeight;
|
||||||
|
}
|
||||||
|
|
||||||
// set flags
|
// set flags
|
||||||
int SdlFlags = SDL_WINDOW_OPENGL;
|
int SdlFlags = SDL_WINDOW_OPENGL;
|
||||||
if(Flags&IGraphicsBackend::INITFLAG_RESIZABLE)
|
if(Flags&IGraphicsBackend::INITFLAG_RESIZABLE)
|
||||||
|
@ -679,7 +686,7 @@ int CGraphicsBackend_SDL_OpenGL::Init(const char *pName, int *Screen, int *pWidt
|
||||||
*pWidth = *pDesktopWidth;
|
*pWidth = *pDesktopWidth;
|
||||||
*pHeight = *pDesktopHeight;
|
*pHeight = *pDesktopHeight;
|
||||||
#else
|
#else
|
||||||
SdlFlags |= (*pWidth == 0 || *pHeight == 0) ? SDL_WINDOW_FULLSCREEN_DESKTOP : SDL_WINDOW_FULLSCREEN; // use desktop resolution as default
|
SdlFlags |= SDL_WINDOW_FULLSCREEN;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// set gl attributes
|
// set gl attributes
|
||||||
|
|
Loading…
Reference in a new issue