diff options
author | Andrei Karas <akaras@inbox.ru> | 2010-07-28 00:06:08 +0300 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-08-03 11:31:47 -0600 |
commit | 98abc793f8fb45d647e1e8c51cf5f38170c6b703 (patch) | |
tree | 04eb93cc58189fcb35b9b77c3259c59e33842d9c /src/resources/image.cpp | |
parent | 12b0ff6204dd64627a3824ba624000424551f054 (diff) | |
download | mana-98abc793f8fb45d647e1e8c51cf5f38170c6b703.tar.gz mana-98abc793f8fb45d647e1e8c51cf5f38170c6b703.tar.bz2 mana-98abc793f8fb45d647e1e8c51cf5f38170c6b703.tar.xz mana-98abc793f8fb45d647e1e8c51cf5f38170c6b703.zip |
Improve OpenGL speed.
Use batch commands and not selecting already selected texture.
Signed-off-by: Jared Adams <jaxad0127@gmail.com>
Diffstat (limited to 'src/resources/image.cpp')
-rw-r--r-- | src/resources/image.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/resources/image.cpp b/src/resources/image.cpp index 0e7dc897..82799bce 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -22,6 +22,11 @@ #include "resources/image.h" #include "resources/dye.h" + +#ifdef USE_OPENGL +#include "openglgraphics.h" +#endif + #include "log.h" #include <SDL_image.h> @@ -467,7 +472,7 @@ Image *Image::_GLload(SDL_Surface *tmpImage) GLuint texture; glGenTextures(1, &texture); - glBindTexture(mTextureType, texture); + OpenGLGraphics::bindTexture(mTextureType, texture); if (SDL_MUSTLOCK(tmpImage)) SDL_LockSurface(tmpImage); |