diff options
author | Mike Krus <mike.krus@kdab.com> | 2020-11-20 17:09:56 +0000 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2020-11-27 18:01:25 +0000 |
commit | 6fac2818ac283c1db0af51a5d8c556fa8afc61ae (patch) | |
tree | 063269f990ff1b35b5552a5e359ae88a00f6d91b /tests/auto/render/opengl/graphicshelpergl3_3/tst_graphicshelpergl3_3.cpp | |
parent | c6716fa7f044985389038802a296bae83951b119 (diff) |
Handle changes in OpenGL classes
Support building against both 5.15 and 6
Change-Id: I46e15f2f898f5f2304075e290798d3d2aea47dad
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'tests/auto/render/opengl/graphicshelpergl3_3/tst_graphicshelpergl3_3.cpp')
-rw-r--r-- | tests/auto/render/opengl/graphicshelpergl3_3/tst_graphicshelpergl3_3.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/auto/render/opengl/graphicshelpergl3_3/tst_graphicshelpergl3_3.cpp b/tests/auto/render/opengl/graphicshelpergl3_3/tst_graphicshelpergl3_3.cpp index 745e3e4af..6cd62a170 100644 --- a/tests/auto/render/opengl/graphicshelpergl3_3/tst_graphicshelpergl3_3.cpp +++ b/tests/auto/render/opengl/graphicshelpergl3_3/tst_graphicshelpergl3_3.cpp @@ -32,7 +32,9 @@ #include <Qt3DRender/private/attachmentpack_p.h> #include <graphicshelpergl3_3_p.h> #include <QOpenGLBuffer> +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include <QOpenGLVersionFunctionsFactory> +#endif #include <QOpenGLFunctions_3_3_Core> #include <QOpenGLShaderProgram> #include <QOpenGLVertexArrayObject> @@ -208,7 +210,11 @@ private Q_SLOTS: return; } +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) if ((m_func = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_3_3_Core>()) != nullptr) { +#else + if ((m_func = m_glContext.versionFunctions<QOpenGLFunctions_3_3_Core>())) { +#endif m_glHelper.initializeHelper(&m_glContext, m_func); m_initializationSuccessful = true; } @@ -647,7 +653,7 @@ private Q_SLOTS: QVERIFY(error == 0); // THEN - QList<QVector4D> colors(512 * 512); + QVector<QVector4D> colors(512 * 512); textures[3]->bind(); m_func->glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_FLOAT, colors.data()); textures[3]->release(); |