summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qopenglcontext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qopenglcontext.cpp')
-rw-r--r--src/gui/kernel/qopenglcontext.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
index d476278a7d..9d8ec11439 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -49,6 +49,7 @@
#include <QtCore/QThread>
#include <QtGui/private/qguiapplication_p.h>
+#include <QtGui/private/qopengl_p.h>
#include <QtGui/private/qwindow_p.h>
#include <QtGui/QScreen>
@@ -402,6 +403,37 @@ QOpenGLFunctions *QOpenGLContext::functions() const
}
/*!
+ Returns the set of OpenGL extensions supported by this context.
+
+ The context or a sharing context must be current.
+
+ \sa hasExtension()
+*/
+QSet<QByteArray> QOpenGLContext::extensions() const
+{
+ Q_D(const QOpenGLContext);
+ if (d->extensionNames.isEmpty()) {
+ QOpenGLExtensionMatcher matcher;
+ d->extensionNames = matcher.extensions();
+ }
+
+ return d->extensionNames;
+}
+
+/*!
+ Returns true if this OpenGL context supports the specified OpenGL
+ \a extension, false otherwise.
+
+ The context or a sharing context must be current.
+
+ \sa extensions()
+*/
+bool QOpenGLContext::hasExtension(const QByteArray &extension) const
+{
+ return extensions().contains(extension);
+}
+
+/*!
Call this to get the default framebuffer object for the current surface.
On some platforms the default framebuffer object depends on the surface