From 81524e1cb634881b7c1629f7030facb308f5f853 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 12 Sep 2017 23:07:39 +0300 Subject: Add option for enable high dpi mode in SDL 2. --- src/graphicsmanager.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/graphicsmanager.cpp') diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp index 0335fe53f..dd730af82 100644 --- a/src/graphicsmanager.cpp +++ b/src/graphicsmanager.cpp @@ -454,6 +454,7 @@ void GraphicsManager::setVideoMode() const bool hwaccel = config.getBoolValue("hwaccel"); const bool enableResize = config.getBoolValue("enableresize"); const bool noFrame = config.getBoolValue("noframe"); + const bool allowHighDPI = config.getBoolValue("allowHighDPI"); #ifdef ANDROID // int width = config.getValue("screenwidth", 0); @@ -488,7 +489,7 @@ void GraphicsManager::setVideoMode() // Try to set the desired video mode if (!mainGraphics->setVideoMode(width, height, scale, bpp, - fullscreen, hwaccel, enableResize, noFrame)) + fullscreen, hwaccel, enableResize, noFrame, allowHighDPI)) { logger->log(strprintf("Couldn't set %dx%dx%d video mode: %s", width, height, bpp, SDL_GetError())); @@ -505,8 +506,14 @@ void GraphicsManager::setVideoMode() config.setValueInt("screenwidth", oldWidth); config.setValueInt("screenheight", oldHeight); config.setValue("screen", oldFullscreen == 1); - if (!mainGraphics->setVideoMode(oldWidth, oldHeight, scale, bpp, - oldFullscreen != 0, hwaccel, enableResize, noFrame)) + if (!mainGraphics->setVideoMode(oldWidth, oldHeight, + scale, + bpp, + oldFullscreen != 0, + hwaccel, + enableResize, + noFrame, + allowHighDPI)) { logger->safeError(strprintf("Couldn't restore %dx%dx%d " "video mode: %s", oldWidth, oldHeight, bpp, -- cgit v1.2.3-70-g09d2