diff options
author | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-12-30 08:21:34 (GMT) |
---|---|---|
committer | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-12-30 12:21:35 (GMT) |
commit | 1f1b37e613a930cc1ab871f5d11bf9742920c7f9 (patch) | |
tree | 432356825b85eba0c8a6b93cc4925dc2401b9021 /src/opengl/qgl_p.h | |
parent | 4bc5082073ef64f5e1cf120eb5190ca0f5dad268 (diff) | |
download | Qt-1f1b37e613a930cc1ab871f5d11bf9742920c7f9.zip Qt-1f1b37e613a930cc1ab871f5d11bf9742920c7f9.tar.gz Qt-1f1b37e613a930cc1ab871f5d11bf9742920c7f9.tar.bz2 |
Track which vertex attrib arrays are enabled in QGLContextPrivate
The GL2 engine (and probably Qt/3D) needs to track which vertex
attribute arrays are currently enabled and which are disabled. As
this is per-context state, the logical place to track this is in the
context and not in the paint engine.
This patch also makes the GL2 engine's shader manager enable/disable
the appropriate attribute arrays for a given shader program when it
is used.
Reviewed-By: Kim
Diffstat (limited to 'src/opengl/qgl_p.h')
-rw-r--r-- | src/opengl/qgl_p.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 99c0f33..834ff96 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -257,6 +257,10 @@ private: class QGLTexture; +// This probably needs to grow to GL_MAX_VERTEX_ATTRIBS, but 3 is ok for now as that's +// all the GL2 engine uses: +#define QT_GL_VERTEX_ARRAY_TRACKED_COUNT 3 + class QGLContextPrivate { Q_DECLARE_PUBLIC(QGLContext) @@ -276,6 +280,9 @@ public: void cleanup(); + void setVertexAttribArrayEnabled(int arrayIndex, bool enabled = true); + void syncGlState(); // Makes sure the GL context's state is what we think it is + #if defined(Q_WS_WIN) HGLRC rc; HDC dc; @@ -332,6 +339,8 @@ public: GLuint default_fbo; QPaintEngine *active_engine; + bool vertexAttributeArraysEnabledState[QT_GL_VERTEX_ARRAY_TRACKED_COUNT]; + static inline QGLContextGroup *contextGroup(const QGLContext *ctx) { return ctx->d_ptr->group; } #ifdef Q_WS_WIN |