diff --git a/sdrbase/gui/glscope.cpp b/sdrbase/gui/glscope.cpp index 5601005e7..a928d2aab 100644 --- a/sdrbase/gui/glscope.cpp +++ b/sdrbase/gui/glscope.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include "gui/glscope.h" #include "dsp/dspengine.h" @@ -256,7 +257,10 @@ void GLScope::initializeGL() connect(glCurrentContext, &QOpenGLContext::aboutToBeDestroyed, this, &GLScope::cleanup); // TODO: when migrating to QOpenGLWidget - glDisable(GL_DEPTH_TEST); + QOpenGLFunctions *glFunctions = QOpenGLContext::currentContext()->functions(); + glFunctions->initializeOpenGLFunctions(); + + //glDisable(GL_DEPTH_TEST); m_glShaderSimple.initializeGL(); m_glShaderLeft1Scale.initializeGL(); m_glShaderBottom1Scale.initializeGL(); @@ -267,7 +271,8 @@ void GLScope::initializeGL() void GLScope::resizeGL(int width, int height) { - glViewport(0, 0, width, height); + QOpenGLFunctions *glFunctions = QOpenGLContext::currentContext()->functions(); + glFunctions->glViewport(0, 0, width, height); m_configChanged = true; } @@ -289,9 +294,10 @@ void GLScope::paintGL() // glPushMatrix(); // glScalef(2.0, -2.0, 1.0); // glTranslatef(-0.50, -0.5, 0); + QOpenGLFunctions *glFunctions = QOpenGLContext::currentContext()->functions(); - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - glClear(GL_COLOR_BUFFER_BIT); + glFunctions->glClearColor(0.0f, 0.0f, 0.0f, 0.0f); + glFunctions->glClear(GL_COLOR_BUFFER_BIT); // I - primary display @@ -1181,7 +1187,7 @@ void GLScope::paintGL() } } // Both displays or secondary display only - glPopMatrix(); +// glPopMatrix(); m_dataChanged = false; m_mutex.unlock(); } diff --git a/sdrbase/gui/glspectrum.cpp b/sdrbase/gui/glspectrum.cpp index 18b9bf4f3..eeb9eacf0 100644 --- a/sdrbase/gui/glspectrum.cpp +++ b/sdrbase/gui/glspectrum.cpp @@ -509,7 +509,7 @@ void GLSpectrum::initializeGL() } connect(glCurrentContext, &QOpenGLContext::aboutToBeDestroyed, this, &GLSpectrum::cleanup); // TODO: when migrating to QOpenGLWidget - glDisable(GL_DEPTH_TEST); + //glDisable(GL_DEPTH_TEST); m_glShaderSimple.initializeGL(); m_glShaderLeftScale.initializeGL(); m_glShaderFrequencyScale.initializeGL();