summaryrefslogtreecommitdiff
path: root/src/graphicsmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-09-01 17:40:11 +0300
committerAndrei Karas <akaras@inbox.ru>2013-09-01 17:57:47 +0300
commit5359b7c20b9ee93989a840e555f0a2102b7bb806 (patch)
treea95017d22a4f3e2f57be59dd4826f3b823a65656 /src/graphicsmanager.cpp
parent222748a7e0c79225c66485898b913aa60f56cfe2 (diff)
downloadmanaverse-5359b7c20b9ee93989a840e555f0a2102b7bb806.tar.gz
manaverse-5359b7c20b9ee93989a840e555f0a2102b7bb806.tar.bz2
manaverse-5359b7c20b9ee93989a840e555f0a2102b7bb806.tar.xz
manaverse-5359b7c20b9ee93989a840e555f0a2102b7bb806.zip
add SDL2 default render mode.
in this mode SDL using own driver with hardware acceleration.
Diffstat (limited to 'src/graphicsmanager.cpp')
-rw-r--r--src/graphicsmanager.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp
index 5304c69c5..1c6f81233 100644
--- a/src/graphicsmanager.cpp
+++ b/src/graphicsmanager.cpp
@@ -241,6 +241,9 @@ void GraphicsManager::initGraphics(const bool noOpenGL)
mUseTextureSampler = false;
break;
case RENDER_NORMAL_OPENGL:
+#ifndef USE_SDL2
+ case RENDER_SDL2_DEFAULT:
+#endif
default:
#ifndef ANDROID
imageHelper = new OpenGLImageHelper;
@@ -261,8 +264,19 @@ void GraphicsManager::initGraphics(const bool noOpenGL)
mainGraphics = new MobileOpenGLGraphics;
mUseTextureSampler = false;
break;
+#ifdef USE_SDL2
+ case RENDER_SDL2_DEFAULT:
+ // for debug SDL2 default is same as software mode
+ imageHelper = new SDLImageHelper;
+ surfaceImageHelper = new SurfaceImageHelper;
+ mainGraphics = new SDLGraphics;
+ mainGraphics->setRendererFlags(SDL_RENDERER_ACCELERATED);
+ mUseTextureSampler = false;
+ break;
+#endif
};
- mUseAtlases = imageHelper->useOpenGL() != RENDER_SOFTWARE
+ mUseAtlases = (useOpenGL == RENDER_NORMAL_OPENGL
+ || useOpenGL == RENDER_SAFE_OPENGL || useOpenGL == RENDER_GLES_OPENGL)
&& config.getBoolValue("useAtlases");
#else
void GraphicsManager::initGraphics(const bool noOpenGL A_UNUSED)