summaryrefslogtreecommitdiff
path: root/src/render/modernopenglgraphics.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-06-12 23:23:00 +0300
committerAndrei Karas <akaras@inbox.ru>2014-06-13 12:41:35 +0300
commitbe74509b31b26e714c6b380e17ed3935ec0b6cf0 (patch)
tree7f575c73694e0cb3673c5b648e7b5e48bc97100f /src/render/modernopenglgraphics.h
parentbcb340f51ca2d69fd062d6548ef283303d43d9ac (diff)
downloadmv-be74509b31b26e714c6b380e17ed3935ec0b6cf0.tar.gz
mv-be74509b31b26e714c6b380e17ed3935ec0b6cf0.tar.bz2
mv-be74509b31b26e714c6b380e17ed3935ec0b6cf0.tar.xz
mv-be74509b31b26e714c6b380e17ed3935ec0b6cf0.zip
In modernopengl add support for buffered draw tile collection.
This is first cached function implemented in modernopengl. Also add support for bind buffer attributes. Add finalize method to convert any cached data into data for GPU.
Diffstat (limited to 'src/render/modernopenglgraphics.h')
-rw-r--r--src/render/modernopenglgraphics.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/render/modernopenglgraphics.h b/src/render/modernopenglgraphics.h
index 651a9462f..d3523ea65 100644
--- a/src/render/modernopenglgraphics.h
+++ b/src/render/modernopenglgraphics.h
@@ -66,6 +66,10 @@ class ModernOpenGLGraphics final : public Graphics
void screenResized();
+ void finalize(ImageCollection *const col) override final;
+
+ void finalize(ImageVertexes *const vert) override final;
+
#include "render/graphicsdef.hpp"
#include "render/openglgraphicsdef.hpp"
@@ -87,10 +91,17 @@ class ModernOpenGLGraphics final : public Graphics
inline void drawTriangleArray(const int size);
+ inline void drawTriangleArray(const GLfloat *const array,
+ const int size);
+
inline void drawLineArrays(const int size);
inline void bindArrayBuffer(const GLuint vbo);
+ inline void bindArrayBufferAndAttributes(const GLuint vbo);
+
+ inline void bindAttributes();
+
GLfloat *mFloatArray;
GLfloat *mFloatArrayCached;
ShaderProgram *mProgram;
@@ -108,6 +119,7 @@ class ModernOpenGLGraphics final : public Graphics
GLuint mVao;
GLuint mVbo;
GLuint mVboCached;
+ GLuint mAttributesCached;
bool mColorAlpha;
bool mTextureDraw;
#ifdef DEBUG_BIND_TEXTURE