summaryrefslogtreecommitdiff
path: root/src/resources/openglimagehelper.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-25 21:43:32 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-26 13:48:26 +0300
commit9abb51fce0cca32ebe267c4797363d99520c2a0a (patch)
treee0a22c5dc699fdd0f85d04ff1aa96196cc8d43ac /src/resources/openglimagehelper.cpp
parent5ff486002243e1481e6686494a85480a85220451 (diff)
downloadplus-9abb51fce0cca32ebe267c4797363d99520c2a0a.tar.gz
plus-9abb51fce0cca32ebe267c4797363d99520c2a0a.tar.bz2
plus-9abb51fce0cca32ebe267c4797363d99520c2a0a.tar.xz
plus-9abb51fce0cca32ebe267c4797363d99520c2a0a.zip
Add initial version of mobile OpenGL backend.
Diffstat (limited to 'src/resources/openglimagehelper.cpp')
-rw-r--r--src/resources/openglimagehelper.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/resources/openglimagehelper.cpp b/src/resources/openglimagehelper.cpp
index a162ccf59..3f825d9db 100644
--- a/src/resources/openglimagehelper.cpp
+++ b/src/resources/openglimagehelper.cpp
@@ -29,6 +29,7 @@
#include "graphicsmanager.h"
#include "logger.h"
#include "mgl.h"
+#include "mobileopenglgraphics.h"
#include "normalopenglgraphics.h"
#include "safeopenglgraphics.h"
@@ -215,15 +216,27 @@ Image *OpenGLImageHelper::glLoad(SDL_Surface *tmpImage)
GLuint texture;
glGenTextures(1, &texture);
- if (mUseOpenGL == 1)
- NormalOpenGLGraphics::bindTexture(mTextureType, texture);
- else if (mUseOpenGL == 2)
- SafeOpenGLGraphics::bindTexture(mTextureType, texture);
+ switch (mUseOpenGL)
+ {
+ case 1:
+ NormalOpenGLGraphics::bindTexture(mTextureType, texture);
+ break;
+ case 2:
+ SafeOpenGLGraphics::bindTexture(mTextureType, texture);
+ break;
+ case 3:
+ MobileOpenGLGraphics::bindTexture(mTextureType, texture);
+ break;
+ default:
+ logger->log("Unknown OpenGL backend: %d", mUseOpenGL);
+ break;
+ }
if (SDL_MUSTLOCK(tmpImage))
SDL_LockSurface(tmpImage);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+
if (!mUseTextureSampler)
{
if (mBlur)