summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbintegration.h
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2012-09-27 15:24:34 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-03 17:22:03 +0200
commit394249616cbb4c0861a032d33f846f85e2801677 (patch)
treed1b7b2b44041be92bbc47f3419866a823ed381c6 /src/plugins/platforms/xcb/qxcbintegration.h
parent84100c9085ddc30368582d02a4229d44622f85e2 (diff)
OpenGL: Don't request a context version higher than is supported
The function wglCreateContextAttribsARB will fail if we request a context version higher than is supported. We therefore upper-bound the requested version by the version of the static context. This results in context creation succeeding and having the closest possible match to the requested format. The xcb qpa plugin is modified to operate similarly to the windows plugin in that it now creates a "static" context which is used to limit the versions of contexts requested by the user. Change-Id: I277ad7cc82edfdf7b9d8502ad921c8175feb1a4a Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbintegration.h')
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbintegration.h b/src/plugins/platforms/xcb/qxcbintegration.h
index 7f7c52372c..669a0d00f6 100644
--- a/src/plugins/platforms/xcb/qxcbintegration.h
+++ b/src/plugins/platforms/xcb/qxcbintegration.h
@@ -51,6 +51,11 @@ class QXcbConnection;
class QAbstractEventDispatcher;
class QXcbNativeInterface;
+#if !defined(QT_NO_OPENGL) && defined(XCB_USE_GLX)
+class QOpenGLDefaultContextInfo;
+class QXcbScreen;
+#endif
+
class QXcbIntegration : public QPlatformIntegration
{
public:
@@ -92,6 +97,10 @@ public:
QStringList themeNames() const;
QPlatformTheme *createPlatformTheme(const QString &name) const;
+#if !defined(QT_NO_OPENGL) && defined(XCB_USE_GLX)
+ void removeDefaultOpenGLContextInfo(QXcbScreen *screen);
+#endif
+
private:
QList<QXcbConnection *> m_connections;
@@ -101,6 +110,10 @@ private:
QScopedPointer<QPlatformInputContext> m_inputContext;
QAbstractEventDispatcher *m_eventDispatcher;
+#if !defined(QT_NO_OPENGL) && defined(XCB_USE_GLX)
+ mutable QHash<QXcbScreen *, QOpenGLDefaultContextInfo *> m_defaultContextInfos;
+#endif
+
#ifndef QT_NO_ACCESSIBILITY
QScopedPointer<QPlatformAccessibility> m_accessibility;
#endif