From 61e9fc59323157bbd3ea024e816981b975d5b2c8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 9 Jun 2014 22:11:31 +0300 Subject: Add basic texture drawing in modernopengl. --- src/render/modernopenglgraphics.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/render/modernopenglgraphics.h') diff --git a/src/render/modernopenglgraphics.h b/src/render/modernopenglgraphics.h index 2e80fb56a..8e60c5b5f 100644 --- a/src/render/modernopenglgraphics.h +++ b/src/render/modernopenglgraphics.h @@ -73,11 +73,17 @@ class ModernOpenGLGraphics final : public Graphics #include "render/openglgraphicsdefadvanced.hpp" private: + void drawQuad(const Image *const image, + const int srcX, const int srcY, + const int dstX, const int dstY, + const int width, const int height); + GLfloat *mFloatTexArray; GLshort *mShortVertArray; GLfloat *mFloatTexArrayCached; GLshort *mShortVertArrayCached; ShaderProgram *mSimpleProgram; + ShaderProgram *mTextureProgram; float mAlphaCached; int mVpCached; bool mTexture; @@ -87,11 +93,16 @@ class ModernOpenGLGraphics final : public Graphics GLuint mImageCached; float mFloatColor; int mMaxVertices; - GLuint mSimpleId; - GLuint mSimpleColor; - GLint mSimplePos; - GLuint mScreenUniform; + GLuint mSimpleProgramId; + GLuint mTextureProgramId; + GLuint mSimpleColorUniform; + GLint mSimplePosAttrib; + GLint mTexturePosAttrib; + GLint mTexAttrib; + GLuint mSimpleScreenUniform; + GLuint mTextureScreenUniform; bool mColorAlpha; + bool mTextureDraw; #ifdef DEBUG_BIND_TEXTURE std::string mOldTexture; unsigned mOldTextureId; -- cgit v1.2.3-60-g2f50