summaryrefslogtreecommitdiff
path: root/src/graphicsmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-12-10 01:28:03 +0300
committerAndrei Karas <akaras@inbox.ru>2015-12-10 01:33:59 +0300
commit93a30ec5dd65df6f91e028e68f18d6a7965240da (patch)
treef2a7908d565dd1e6f856e8c058fbc40f50dbb1cb /src/graphicsmanager.cpp
parent07daba6efa05a59271ce4173a2b500b27773e523 (diff)
downloadmanaplus-93a30ec5dd65df6f91e028e68f18d6a7965240da.tar.gz
manaplus-93a30ec5dd65df6f91e028e68f18d6a7965240da.tar.bz2
manaplus-93a30ec5dd65df6f91e028e68f18d6a7965240da.tar.xz
manaplus-93a30ec5dd65df6f91e028e68f18d6a7965240da.zip
Add support for mobileopengl2 backend (still copy from modern opengl).
Diffstat (limited to 'src/graphicsmanager.cpp')
-rw-r--r--src/graphicsmanager.cpp35
1 files changed, 27 insertions, 8 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp
index 719f072c6..05e4de782 100644
--- a/src/graphicsmanager.cpp
+++ b/src/graphicsmanager.cpp
@@ -48,6 +48,7 @@
#include "render/mglcheck.h"
#include "render/mgl.h"
#include "render/mglemu.h"
+#include "render/mobileopengl2graphics.h"
#include "render/mobileopenglgraphics.h"
#include "render/modernopenglgraphics.h"
#include "render/normalopenglgraphics.h"
@@ -306,6 +307,12 @@ void GraphicsManager::createRenderers()
mainGraphics = new ModernOpenGLGraphics;
mUseTextureSampler = true;
break;
+ case RENDER_GLES2_OPENGL:
+ imageHelper = new OpenGLImageHelper;
+ surfaceImageHelper = new SurfaceImageHelper;
+ mainGraphics = new MobileOpenGL2Graphics;
+ mUseTextureSampler = false;
+ break;
#endif
case RENDER_GLES_OPENGL:
imageHelper = new OpenGLImageHelper;
@@ -323,11 +330,12 @@ void GraphicsManager::createRenderers()
break;
#endif
};
- mUseAtlases = (useOpenGL == RENDER_NORMAL_OPENGL
- || useOpenGL == RENDER_SAFE_OPENGL
- || useOpenGL == RENDER_MODERN_OPENGL
- || useOpenGL == RENDER_GLES_OPENGL)
- && config.getBoolValue("useAtlases");
+ mUseAtlases = (useOpenGL == RENDER_NORMAL_OPENGL ||
+ useOpenGL == RENDER_SAFE_OPENGL ||
+ useOpenGL == RENDER_MODERN_OPENGL ||
+ useOpenGL == RENDER_GLES_OPENGL ||
+ useOpenGL == RENDER_GLES2_OPENGL) &&
+ config.getBoolValue("useAtlases");
#else // USE_OPENGL
@@ -346,6 +354,7 @@ void GraphicsManager::createRenderers()
case RENDER_SOFTWARE:
case RENDER_SAFE_OPENGL:
case RENDER_GLES_OPENGL:
+ case RENDER_GLES2_OPENGL:
case RENDER_MODERN_OPENGL:
case RENDER_NORMAL_OPENGL:
case RENDER_NULL:
@@ -487,6 +496,15 @@ void GraphicsManager::initGraphics()
openGLMode = RENDER_SAFE_OPENGL;
}
}
+ if (openGLMode == RENDER_GLES2_OPENGL)
+ {
+ // +++ here need check also not implimented gles flag
+ if (!checkGLVersion(2, 0))
+ {
+ logger->log("Fallback to safe OpenGL mode");
+ openGLMode = RENDER_SAFE_OPENGL;
+ }
+ }
if (openGLMode != oldOpenGLMode && !settings.options.test.empty())
{
deleteRenderers();
@@ -732,9 +750,10 @@ void GraphicsManager::updateTextureFormat() const
const int renderer = settings.options.renderer;
// using default formats
- if (renderer == RENDER_MODERN_OPENGL
- || renderer == RENDER_GLES_OPENGL
- || config.getBoolValue("newtextures"))
+ if (renderer == RENDER_MODERN_OPENGL ||
+ renderer == RENDER_GLES_OPENGL ||
+ renderer == RENDER_GLES2_OPENGL ||
+ config.getBoolValue("newtextures"))
{
OpenGLImageHelper::setInternalTextureType(GL_RGBA);
logger->log1("using RGBA texture format");