summaryrefslogtreecommitdiff
path: root/src/graphicsmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-09-12 23:07:39 +0300
committerAndrei Karas <akaras@inbox.ru>2017-09-12 23:28:39 +0300
commit81524e1cb634881b7c1629f7030facb308f5f853 (patch)
tree318f0ef6b48e49cb420760afd5fe2f728e35a309 /src/graphicsmanager.cpp
parent96aaa9f5d56637373fe474b0113b9e6ba083a12a (diff)
downloadplus-81524e1cb634881b7c1629f7030facb308f5f853.tar.gz
plus-81524e1cb634881b7c1629f7030facb308f5f853.tar.bz2
plus-81524e1cb634881b7c1629f7030facb308f5f853.tar.xz
plus-81524e1cb634881b7c1629f7030facb308f5f853.zip
Add option for enable high dpi mode in SDL 2.
Diffstat (limited to 'src/graphicsmanager.cpp')
-rw-r--r--src/graphicsmanager.cpp13
1 files changed, 10 insertions, 3 deletions
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,