summaryrefslogtreecommitdiff
path: root/src/graphicsmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/graphicsmanager.cpp')
-rw-r--r--src/graphicsmanager.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp
index 8dffafeb4..cb546e752 100644
--- a/src/graphicsmanager.cpp
+++ b/src/graphicsmanager.cpp
@@ -92,6 +92,8 @@
GraphicsManager graphicsManager;
+RenderType openGLMode = RENDER_SOFTWARE;
+
const int densitySize = 6;
const std::string densityNames[] =
@@ -414,6 +416,24 @@ void GraphicsManager::setVideoMode()
}
}
+void GraphicsManager::initGraphics(const bool noOpenGL)
+{
+ openGLMode = intToRenderType(config.getIntValue("opengl"));
+#ifdef USE_OPENGL
+ OpenGLImageHelper::setBlur(config.getBoolValue("blur"));
+ SurfaceImageHelper::SDLSetEnableAlphaCache(
+ config.getBoolValue("alphaCache") && !openGLMode);
+ ImageHelper::setEnableAlpha(config.getFloatValue("guialpha") != 1.0F
+ || openGLMode);
+#else
+ SurfaceImageHelper::SDLSetEnableAlphaCache(
+ config.getBoolValue("alphaCache"));
+ ImageHelper::setEnableAlpha(config.getFloatValue("guialpha") != 1.0F);
+#endif
+ createRenderers(noOpenGL);
+ detectPixelSize();
+}
+
#ifdef USE_SDL2
SDL_Window *GraphicsManager::createWindow(const int w, const int h,
const int bpp A_UNUSED,