summaryrefslogtreecommitdiffstats
path: root/src/datavisualization/utils/texturehelper.cpp
diff options
context:
space:
mode:
authorTomi Korpipaa <tomi.korpipaa@qt.io>2020-12-10 07:12:10 +0200
committerTomi Korpipaa <tomi.korpipaa@qt.io>2020-12-14 06:57:52 +0200
commit471a6cbd07fddd3f392204d532ac8d3639c7dc7f (patch)
treecd4aa8b6cda0bb52e851d7ced1a3a93b8a8fa622 /src/datavisualization/utils/texturehelper.cpp
parent058eab02a5c1d8d8de8917d473eb39aa18a1c888 (diff)
Migrate C++ API rendering path to Qt 6
Replace QRegExp with QRegularExpression and change usage accordingly. Replace shared QOpenGLFunctions_2_1 with our own copy. Fix header include changes. Task-number: QTBUG-89297 Change-Id: I6d3cf36ba9303ef62db3220816ea35f51eb26a3c Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/datavisualization/utils/texturehelper.cpp')
-rw-r--r--src/datavisualization/utils/texturehelper.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/datavisualization/utils/texturehelper.cpp b/src/datavisualization/utils/texturehelper.cpp
index 0e66459c..4ff56cb3 100644
--- a/src/datavisualization/utils/texturehelper.cpp
+++ b/src/datavisualization/utils/texturehelper.cpp
@@ -47,8 +47,7 @@ TextureHelper::TextureHelper()
// Discard warnings about deprecated functions
QtMessageHandler handler = qInstallMessageHandler(discardDebugMsgs);
- m_openGlFunctions_2_1 =
- QOpenGLContext::currentContext()->versionFunctions<QOpenGLFunctions_2_1>();
+ m_openGlFunctions_2_1 = new QOpenGLFunctions_2_1;
if (m_openGlFunctions_2_1)
m_openGlFunctions_2_1->initializeOpenGLFunctions();
@@ -63,6 +62,7 @@ TextureHelper::TextureHelper()
TextureHelper::~TextureHelper()
{
+ delete m_openGlFunctions_2_1;
}
GLuint TextureHelper::create2DTexture(const QImage &image, bool useTrilinearFiltering,
@@ -328,7 +328,7 @@ GLuint TextureHelper::createDepthTextureFrameBuffer(const QSize &size, GLuint &f
// Attach texture to depth attachment
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, depthtextureid, 0);
- m_openGlFunctions_2_1->glDrawBuffer(GL_NONE);
+ m_openGlFunctions_2_1->glDrawBuffers(0, GL_NONE);
m_openGlFunctions_2_1->glReadBuffer(GL_NONE);
// Verify that the frame buffer is complete