diff options
author | Andrei Karas <akaras@inbox.ru> | 2010-07-28 00:06:08 +0300 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-07-27 16:00:12 -0600 |
commit | 04cefb857e2738c103b81f8ac1502f344d84c16f (patch) | |
tree | 7da1e5b6c981485f32833c262c4c136f88612bac /src/openglgraphics.h | |
parent | 0875b7ecb46f93e408a560f0033da392f0a4d3b2 (diff) | |
download | mana-04cefb857e2738c103b81f8ac1502f344d84c16f.tar.gz mana-04cefb857e2738c103b81f8ac1502f344d84c16f.tar.bz2 mana-04cefb857e2738c103b81f8ac1502f344d84c16f.tar.xz mana-04cefb857e2738c103b81f8ac1502f344d84c16f.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.h | 23 |
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; |