From 471a6cbd07fddd3f392204d532ac8d3639c7dc7f Mon Sep 17 00:00:00 2001 From: Tomi Korpipaa Date: Thu, 10 Dec 2020 07:12:10 +0200 Subject: 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 --- src/datavisualization/utils/texturehelper.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/datavisualization/utils/texturehelper.cpp') 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(); + 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 -- cgit v1.2.3