Who doesn't enjoy fixing Windows stuff?

This commit is contained in:
Dennis Felsing 2017-07-11 14:08:03 +02:00
parent 8b5ee98193
commit 81c6d0b33c

View file

@ -594,13 +594,29 @@ int CGraphicsBackend_SDL_OpenGL::Init(const char *pName, int *Screen, int *pWidt
*pDesktopHeight = DisplayMode.h; *pDesktopHeight = DisplayMode.h;
// use desktop resolution as default resolution // use desktop resolution as default resolution
#ifndef __ANDROID__ #ifdef __ANDROID__
*pWidth = *pDesktopWidth;
*pHeight = *pDesktopHeight;
#elif defined(CONF_FAMILY_WINDOWS)
if(*pWidth == 0 || *pHeight == 0) if(*pWidth == 0 || *pHeight == 0)
#endif
{ {
*pWidth = *pDesktopWidth; *pWidth = *pDesktopWidth;
*pHeight = *pDesktopHeight; *pHeight = *pDesktopHeight;
} }
else
{
float dpi;
SDL_GetDisplayDPI(0, NULL, &dpi, NULL);
pWidth /= dpi;
pHeight /= dpi;
}
#else
if(*pWidth == 0 || *pHeight == 0)
{
*pWidth = *pDesktopWidth;
*pHeight = *pDesktopHeight;
}
#endif
// set flags // set flags
int SdlFlags = SDL_WINDOW_OPENGL | SDL_WINDOW_HIDDEN; int SdlFlags = SDL_WINDOW_OPENGL | SDL_WINDOW_HIDDEN;