Merge remote-tracking branch 'origin/12.0-development' into vulkan

This commit is contained in:
niki
2022-06-12 02:06:44 +02:00
+8 -1
View File
@@ -72,6 +72,12 @@ Window::Window()
, hasSDL203orEarlier(false) , hasSDL203orEarlier(false)
, contextAttribs() , contextAttribs()
{ {
// Windows uses a different API than SDL_WINDOW_ALLOW_HIGHDPI.
#if defined(LOVE_WINDOWS) && defined(SDL_HINT_WINDOWS_DPI_SCALING)
// This must be set before the video subsystem is initialized.
SDL_SetHint(SDL_HINT_WINDOWS_DPI_SCALING, isHighDPIAllowed() ? "1" : "0");
#endif
if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0)
throw love::Exception("Could not initialize SDL video subsystem (%s)", SDL_GetError()); throw love::Exception("Could not initialize SDL video subsystem (%s)", SDL_GetError());
@@ -607,7 +613,8 @@ bool Window::setWindow(int width, int height, WindowSettings *settings)
if (f.borderless) if (f.borderless)
sdlflags |= SDL_WINDOW_BORDERLESS; sdlflags |= SDL_WINDOW_BORDERLESS;
if (isHighDPIAllowed()) // Note: this flag is ignored on Windows.
if (isHighDPIAllowed())
sdlflags |= SDL_WINDOW_ALLOW_HIGHDPI; sdlflags |= SDL_WINDOW_ALLOW_HIGHDPI;
if (!createWindowAndContext(x, y, width, height, sdlflags, renderer)) if (!createWindowAndContext(x, y, width, height, sdlflags, renderer))