summaryrefslogtreecommitdiff
path: root/src/resources/image.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2010-07-28 00:06:08 +0300
committerJared Adams <jaxad0127@gmail.com>2010-08-03 11:31:47 -0600
commit98abc793f8fb45d647e1e8c51cf5f38170c6b703 (patch)
tree04eb93cc58189fcb35b9b77c3259c59e33842d9c /src/resources/image.cpp
parent12b0ff6204dd64627a3824ba624000424551f054 (diff)
downloadMana-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.cpp7
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);