diff options
author | Samuel Rødal <samuel.rodal@digia.com> | 2012-10-01 10:17:21 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-19 18:11:06 +0200 |
commit | cdc2161b6f87deaac6a256885fd6ecdccad6eb82 (patch) | |
tree | 3d2cd1a20e2b4a0b7e871c6ab78b4fa2bcaf9195 /src/plugins/platforms/xcb/qxcbintegration.cpp | |
parent | 7d7f09650c3b3b2990f16ff4a6401a8c74e1f868 (diff) |
Made xcb plugin work when the GLX extension is not present.
Change-Id: I9285d7524586ff404206c088019ece33335137d9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbintegration.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbintegration.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 2ace68036b..f6077316e6 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -192,9 +192,11 @@ QPlatformOpenGLContext *QXcbIntegration::createPlatformOpenGLContext(QOpenGLCont screen->connection()->egl_display(), screen->connection()); #elif defined(XCB_USE_DRI2) return new QDri2Context(context->format(), context->shareHandle()); -#endif +#else + Q_UNUSED(screen); qWarning("QXcbIntegration: Cannot create platform OpenGL context, none of GLX, EGL, or DRI2 are enabled"); return 0; +#endif } #endif @@ -207,7 +209,13 @@ bool QXcbIntegration::hasCapability(QPlatformIntegration::Capability cap) const { switch (cap) { case ThreadedPixmaps: return true; +#if defined(XCB_USE_GLX) + case OpenGL: return m_connections.at(0)->hasGLX(); +#elif defined(XCB_USE_EGL) || defined(XCB_USE_DRI2) case OpenGL: return true; +#else + case OpenGL: return false; +#endif case ThreadedOpenGL: return false; case WindowMasks: return true; default: return QPlatformIntegration::hasCapability(cap); |