diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-06-08 01:04:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-06-08 01:04:33 +0300 |
commit | 410dd6c3d845cc0e19fd678090d95669bdeb5885 (patch) | |
tree | d9f0003f0f68212d1c99890f603c3d280b24669b /src/graphicsmanager.cpp | |
parent | dce5065a2df5f6ac0057702f704b6ab4f16ce8f8 (diff) | |
download | manaplus-410dd6c3d845cc0e19fd678090d95669bdeb5885.tar.gz manaplus-410dd6c3d845cc0e19fd678090d95669bdeb5885.tar.bz2 manaplus-410dd6c3d845cc0e19fd678090d95669bdeb5885.tar.xz manaplus-410dd6c3d845cc0e19fd678090d95669bdeb5885.zip |
Add Modern OpenGL render type.
Now it using normal OpenGL renderer.
Diffstat (limited to 'src/graphicsmanager.cpp')
-rw-r--r-- | src/graphicsmanager.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp index 90f723f82..33cbd0224 100644 --- a/src/graphicsmanager.cpp +++ b/src/graphicsmanager.cpp @@ -272,6 +272,7 @@ void GraphicsManager::createRenderers() mUseTextureSampler = false; break; case RENDER_NORMAL_OPENGL: + case RENDER_MODERN_OPENGL: #ifndef USE_SDL2 case RENDER_SDL2_DEFAULT: #endif @@ -328,6 +329,7 @@ void GraphicsManager::createRenderers() case RENDER_SOFTWARE: case RENDER_SAFE_OPENGL: case RENDER_GLES_OPENGL: + case RENDER_MODERN_OPENGL: case RENDER_NORMAL_OPENGL: case RENDER_NULL: case RENDER_LAST: @@ -450,18 +452,30 @@ void GraphicsManager::initGraphics() detectPixelSize(); setVideoMode(); #ifdef USE_OPENGL + const RenderType oldOpenGLMode = openGLMode; + if (openGLMode == RENDER_MODERN_OPENGL) + { + if (!checkGLVersion(3, 0)) + { + logger->log("Fallback to normal OpenGL mode"); + openGLMode = RENDER_NORMAL_OPENGL; + } + } if (openGLMode == RENDER_NORMAL_OPENGL || openGLMode == RENDER_GLES_OPENGL) { if (!checkGLVersion(2, 0)) { logger->log("Fallback to safe OpenGL mode"); openGLMode = RENDER_SAFE_OPENGL; - deleteRenderers(); - createRenderers(); - detectPixelSize(); - setVideoMode(); } } + if (openGLMode != oldOpenGLMode) + { + deleteRenderers(); + createRenderers(); + detectPixelSize(); + setVideoMode(); + } #endif } @@ -688,9 +702,6 @@ void GraphicsManager::updateTextureFormat() const logger->log1("using 4 texture format"); } } -#endif - -#ifdef USE_OPENGL void GraphicsManager::logString(const char *const format, const int num) { |