diff options
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbnativeinterface.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbnativeinterface.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp index 2a36fb7369..fa5f5f43d0 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp @@ -53,6 +53,8 @@ #if defined(XCB_USE_EGL) #include "QtPlatformSupport/private/qeglplatformcontext_p.h" +#elif defined (XCB_USE_GLX) +#include "qglxintegration.h" #endif QT_BEGIN_NAMESPACE @@ -68,6 +70,7 @@ public: insert("connection",QXcbNativeInterface::Connection); insert("screen",QXcbNativeInterface::Screen); insert("eglcontext",QXcbNativeInterface::EglContext); + insert("glxcontext",QXcbNativeInterface::GLXContext); } }; @@ -91,6 +94,9 @@ void *QXcbNativeInterface::nativeResourceForContext(const QByteArray &resourceSt case EglContext: result = eglContextForContext(context); break; + case GLXContext: + result = glxContextForContext(context); + break; default: break; } @@ -191,4 +197,17 @@ void * QXcbNativeInterface::eglContextForContext(QOpenGLContext *context) #endif } +void *QXcbNativeInterface::glxContextForContext(QOpenGLContext *context) +{ + Q_ASSERT(context); +#if defined(XCB_USE_GLX) + QGLXContext *glxPlatformContext = static_cast<QGLXContext *>(context->handle()); + return glxPlatformContext->glxContext(); +#else + Q_UNUSED(context); + return 0; +#endif + +} + QT_END_NAMESPACE |