diff options
Diffstat (limited to 'src/opengl/qopenglvertexarrayobject_p.h')
-rw-r--r-- | src/opengl/qopenglvertexarrayobject_p.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/opengl/qopenglvertexarrayobject_p.h b/src/opengl/qopenglvertexarrayobject_p.h index 0d0fca4d81..bd50d86073 100644 --- a/src/opengl/qopenglvertexarrayobject_p.h +++ b/src/opengl/qopenglvertexarrayobject_p.h @@ -57,25 +57,27 @@ QT_BEGIN_NAMESPACE -class QOpenGLVertexArrayObjectHelper; class QOpenGLContext; -void Q_OPENGL_EXPORT qtInitializeVertexArrayObjectHelper(QOpenGLVertexArrayObjectHelper *helper, QOpenGLContext *context); - class QOpenGLVertexArrayObjectHelper { Q_DISABLE_COPY(QOpenGLVertexArrayObjectHelper) -public: +private: explicit inline QOpenGLVertexArrayObjectHelper(QOpenGLContext *context) : GenVertexArrays(nullptr) , DeleteVertexArrays(nullptr) , BindVertexArray(nullptr) , IsVertexArray(nullptr) { - qtInitializeVertexArrayObjectHelper(this, context); + initializeFromContext(context); } + void Q_OPENGL_EXPORT initializeFromContext(QOpenGLContext *context); + +public: + static Q_OPENGL_EXPORT QOpenGLVertexArrayObjectHelper *vertexArrayObjectHelperForContext(QOpenGLContext *context); + inline bool isValid() const { return GenVertexArrays && DeleteVertexArrays && BindVertexArray && IsVertexArray; @@ -101,9 +103,6 @@ public: return IsVertexArray(array); } -private: - friend void Q_OPENGL_EXPORT qtInitializeVertexArrayObjectHelper(QOpenGLVertexArrayObjectHelper *helper, QOpenGLContext *context); - // Function signatures are equivalent between desktop core, ARB, APPLE, ES 3 and ES 2 extensions typedef void (QOPENGLF_APIENTRYP qt_GenVertexArrays_t)(GLsizei n, GLuint *arrays); typedef void (QOPENGLF_APIENTRYP qt_DeleteVertexArrays_t)(GLsizei n, const GLuint *arrays); |