summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopengldebug.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-03-04 15:06:36 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-10 15:10:37 +0100
commit1e8de50674f5b33a50c45224b7e07b3f974f6ab0 (patch)
treea52d4e421be3c6c2deb4ff07905d5715012b0d9a /src/gui/opengl/qopengldebug.cpp
parent11eb9d37dc191b6e71c903e4f7f4d2da579e7df5 (diff)
Avoid using direct OpenGL calls in gui and widgets
Change-Id: I5d88a2e204ca23e178a4e3044b9cb13392c3e763 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/gui/opengl/qopengldebug.cpp')
-rw-r--r--src/gui/opengl/qopengldebug.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/gui/opengl/qopengldebug.cpp b/src/gui/opengl/qopengldebug.cpp
index cc6e945954..79b59a8e98 100644
--- a/src/gui/opengl/qopengldebug.cpp
+++ b/src/gui/opengl/qopengldebug.cpp
@@ -43,6 +43,7 @@
#include <QtCore/qglobal.h>
#include <QtCore/qvarlengtharray.h>
#include <QtGui/qopengl.h>
+#include <QtGui/qopenglfunctions.h>
#include "qopengldebug.h"
@@ -1380,7 +1381,7 @@ bool QOpenGLDebugLogger::initialize()
#undef GET_DEBUG_PROC_ADDRESS
- glGetIntegerv(GL_MAX_DEBUG_MESSAGE_LENGTH, &d->maxMessageLength);
+ QOpenGLContext::currentContext()->functions()->glGetIntegerv(GL_MAX_DEBUG_MESSAGE_LENGTH, &d->maxMessageLength);
#ifndef QT_NO_DEBUG
if (!d->context->format().testOption(QSurfaceFormat::DebugContext)) {
@@ -1448,15 +1449,16 @@ void QOpenGLDebugLogger::startLogging(QOpenGLDebugLogger::LoggingMode loggingMod
d->glDebugMessageCallback(&qt_opengl_debug_callback, d);
- d->debugWasEnabled = glIsEnabled(GL_DEBUG_OUTPUT);
- d->syncDebugWasEnabled = glIsEnabled(GL_DEBUG_OUTPUT_SYNCHRONOUS);
+ QOpenGLFunctions *funcs = QOpenGLContext::currentContext()->functions();
+ d->debugWasEnabled = funcs->glIsEnabled(GL_DEBUG_OUTPUT);
+ d->syncDebugWasEnabled = funcs->glIsEnabled(GL_DEBUG_OUTPUT_SYNCHRONOUS);
if (d->loggingMode == SynchronousLogging)
- glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
+ funcs->glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
else
- glDisable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
+ funcs->glDisable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
- glEnable(GL_DEBUG_OUTPUT);
+ funcs->glEnable(GL_DEBUG_OUTPUT);
}
/*!
@@ -1485,13 +1487,14 @@ void QOpenGLDebugLogger::stopLogging()
d->glDebugMessageCallback(d->oldDebugCallbackFunction, d->oldDebugCallbackParameter);
+ QOpenGLFunctions *funcs = QOpenGLContext::currentContext()->functions();
if (!d->debugWasEnabled)
- glDisable(GL_DEBUG_OUTPUT);
+ funcs->glDisable(GL_DEBUG_OUTPUT);
if (d->syncDebugWasEnabled)
- glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
+ funcs->glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
else
- glDisable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
+ funcs->glDisable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
}
/*!