summaryrefslogtreecommitdiff
path: root/src/openglgraphics.h
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/openglgraphics.h
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/openglgraphics.h')
-rw-r--r--src/openglgraphics.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/openglgraphics.h b/src/openglgraphics.h
index 03738bfb..ee96e19c 100644
--- a/src/openglgraphics.h
+++ b/src/openglgraphics.h
@@ -22,8 +22,16 @@
#ifndef OPENGLGRAPHICS_H
#define OPENGLGRAPHICS_H
+#include "main.h"
+
#include "graphics.h"
+#ifdef USE_OPENGL
+#define NO_SDL_GLEXT
+
+#include <SDL_opengl.h>
+#endif
+
class OpenGLGraphics : public Graphics
{
public:
@@ -72,8 +80,8 @@ class OpenGLGraphics : public Graphics
* Draw a pattern based on a rescaled version of the given image...
*/
void drawRescaledImagePattern(Image *image,
- int x, int y, int w, int h,
- int scaledWidth, int scaledHeight);
+ int x, int y, int w, int h,
+ int scaledWidth, int scaledHeight);
void updateScreen();
@@ -97,15 +105,26 @@ class OpenGLGraphics : public Graphics
void setTargetPlane(int width, int height);
+ void drawQuadArrayfi(int size);
+
+ void drawQuadArrayii(int size);
+
/**
* Takes a screenshot and returns it as SDL surface.
*/
SDL_Surface *getScreenshot();
+ static void bindTexture(GLenum target, GLuint texture);
+
+ static GLuint mLastImage;
+
protected:
void setTexturingAndBlending(bool enable);
private:
+ GLfloat *mFloatTexArray;
+ GLint *mIntTexArray;
+ GLint *mIntVertArray;
bool mAlpha, mTexture;
bool mColorAlpha;
bool mSync;