diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-10-25 21:43:32 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-10-26 13:48:26 +0300 |
commit | 9abb51fce0cca32ebe267c4797363d99520c2a0a (patch) | |
tree | e0a22c5dc699fdd0f85d04ff1aa96196cc8d43ac /src/resources | |
parent | 5ff486002243e1481e6686494a85480a85220451 (diff) | |
download | manaplus-9abb51fce0cca32ebe267c4797363d99520c2a0a.tar.gz manaplus-9abb51fce0cca32ebe267c4797363d99520c2a0a.tar.bz2 manaplus-9abb51fce0cca32ebe267c4797363d99520c2a0a.tar.xz manaplus-9abb51fce0cca32ebe267c4797363d99520c2a0a.zip |
Add initial version of mobile OpenGL backend.
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/image.cpp | 1 | ||||
-rw-r--r-- | src/resources/image.h | 1 | ||||
-rw-r--r-- | src/resources/openglimagehelper.cpp | 21 | ||||
-rw-r--r-- | src/resources/subimage.cpp | 1 |
4 files changed, 20 insertions, 4 deletions
diff --git a/src/resources/image.cpp b/src/resources/image.cpp index b342edcbf..c71cbdec9 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -26,6 +26,7 @@ #include "resources/resourcemanager.h" #ifdef USE_OPENGL +#include "mobileopenglgraphics.h" #include "normalopenglgraphics.h" #include "safeopenglgraphics.h" #endif diff --git a/src/resources/image.h b/src/resources/image.h index 36404b2b1..87a842aa3 100644 --- a/src/resources/image.h +++ b/src/resources/image.h @@ -64,6 +64,7 @@ class Image : public Resource friend class SDLImageHelper; #ifdef USE_OPENGL friend class AtlasManager; + friend class MobileOpenGLGraphics; friend class NormalOpenGLGraphics; friend class SafeOpenGLGraphics; #endif 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) diff --git a/src/resources/subimage.cpp b/src/resources/subimage.cpp index a2d6a8c33..bb63f842a 100644 --- a/src/resources/subimage.cpp +++ b/src/resources/subimage.cpp @@ -23,6 +23,7 @@ #include "resources/subimage.h" #ifdef USE_OPENGL +#include "mobileopenglgraphics.h" #include "normalopenglgraphics.h" #include "safeopenglgraphics.h" #endif |