From 6eea94308328a897c3f45e39a17120753adb7ff2 Mon Sep 17 00:00:00 2001 From: Tom Lankhorst Date: Mon, 21 Oct 2019 22:36:05 +0200 Subject: [PATCH] Pass SDL_WINDOW_ALLOW_HIGHDPI to SDL_CreateWindow (#10125) --- distribution/changelog.txt | 1 + src/openrct2-ui/UiContext.cpp | 2 +- src/openrct2-ui/drawing/engines/opengl/OpenGLFramebuffer.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index acba82a54d..6b23fc3686 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -33,6 +33,7 @@ - Fix: [#10106]: Ride circuits should not be used for modes that do not support it. - Improved: [#9466] Add the rain weather effect to the OpenGL renderer. - Improved: [#9987] Minimum load rounding. +- Improved: [#10125] Better support for high DPI screens. 0.2.3 (2019-07-10) ------------------------------------------------------------------------ diff --git a/src/openrct2-ui/UiContext.cpp b/src/openrct2-ui/UiContext.cpp index 9928a95787..6db70d3f73 100644 --- a/src/openrct2-ui/UiContext.cpp +++ b/src/openrct2-ui/UiContext.cpp @@ -639,7 +639,7 @@ private: height = 480; // Create window in window first rather than fullscreen so we have the display the window is on first - uint32_t flags = SDL_WINDOW_RESIZABLE; + uint32_t flags = SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI; if (gConfigGeneral.drawing_engine == DRAWING_ENGINE_OPENGL) { flags |= SDL_WINDOW_OPENGL; diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLFramebuffer.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLFramebuffer.cpp index fe1c15945b..e8951c9404 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLFramebuffer.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLFramebuffer.cpp @@ -23,7 +23,7 @@ OpenGLFramebuffer::OpenGLFramebuffer(SDL_Window* window) _id = BACKBUFFER_ID; _texture = 0; _depth = 0; - SDL_GetWindowSize(window, &_width, &_height); + SDL_GL_GetDrawableSize(window, &_width, &_height); } OpenGLFramebuffer::OpenGLFramebuffer(int32_t width, int32_t height, bool depth, bool integer)