summaryrefslogtreecommitdiff
path: root/src/resources/openglimagehelper.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-09-01 00:50:45 +0300
committerAndrei Karas <akaras@inbox.ru>2013-09-01 00:50:45 +0300
commitaf374aa2b2944749193af49cdca28532cf56fae2 (patch)
treeb3e4fd2609a00175dbd94e42ab3d72984b4a051b /src/resources/openglimagehelper.cpp
parent00cda69b883d6354f093be6ee39a7936cb798979 (diff)
downloadmanaplus-af374aa2b2944749193af49cdca28532cf56fae2.tar.gz
manaplus-af374aa2b2944749193af49cdca28532cf56fae2.tar.bz2
manaplus-af374aa2b2944749193af49cdca28532cf56fae2.tar.xz
manaplus-af374aa2b2944749193af49cdca28532cf56fae2.zip
add renderer enum.
Diffstat (limited to 'src/resources/openglimagehelper.cpp')
-rw-r--r--src/resources/openglimagehelper.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/resources/openglimagehelper.cpp b/src/resources/openglimagehelper.cpp
index 7fa779fa8..e686d6f5a 100644
--- a/src/resources/openglimagehelper.cpp
+++ b/src/resources/openglimagehelper.cpp
@@ -32,6 +32,7 @@
#include "render/mobileopenglgraphics.h"
#include "render/normalopenglgraphics.h"
+#include "render/renderers.h"
#include "render/safeopenglgraphics.h"
#include "resources/dye.h"
@@ -49,7 +50,7 @@ int OpenGLImageHelper::mTextureType = 0;
int OpenGLImageHelper::mInternalTextureType = GL_RGBA8;
int OpenGLImageHelper::mTextureSize = 0;
bool OpenGLImageHelper::mBlur = true;
-int OpenGLImageHelper::mUseOpenGL = 0;
+RenderType OpenGLImageHelper::mUseOpenGL = RENDER_SOFTWARE;
bool OpenGLImageHelper::mUseTextureSampler = false;
Image *OpenGLImageHelper::load(SDL_RWops *const rw, Dye const &dye) const
@@ -200,19 +201,20 @@ Image *OpenGLImageHelper::glLoad(SDL_Surface *tmpImage,
switch (mUseOpenGL)
{
#ifndef ANDROID
- case 1:
+ case RENDER_NORMAL_OPENGL:
NormalOpenGLGraphics::bindTexture(mTextureType, texture);
break;
- case 2:
+ case RENDER_SAFE_OPENGL:
SafeOpenGLGraphics::bindTexture(mTextureType, texture);
break;
#else
- case 1:
- case 2:
+ case RENDER_NORMAL_OPENGL:
+ case RENDER_SAFE_OPENGL:
#endif
- case 3:
+ case RENDER_GLES_OPENGL:
MobileOpenGLGraphics::bindTexture(mTextureType, texture);
break;
+ case RENDER_SOFTWARE:
default:
logger->log("Unknown OpenGL backend: %d", mUseOpenGL);
break;
@@ -276,12 +278,12 @@ Image *OpenGLImageHelper::glLoad(SDL_Surface *tmpImage,
return new Image(texture, width, height, realWidth, realHeight);
}
-void OpenGLImageHelper::setLoadAsOpenGL(const int useOpenGL)
+void OpenGLImageHelper::setLoadAsOpenGL(const RenderType useOpenGL)
{
- OpenGLImageHelper::mUseOpenGL = useOpenGL;
+ mUseOpenGL = useOpenGL;
}
-int OpenGLImageHelper::useOpenGL() const
+RenderType OpenGLImageHelper::useOpenGL() const
{
return mUseOpenGL;
}