diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-03-17 10:35:35 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-24 09:10:29 +0200 |
commit | af1e32426c50694c0e4c1c292aa5eeee3b38c7bc (patch) | |
tree | 041b8176b646e059b4a2cece890ac33fc1388a39 /src/plugins/platforms/xcb/qxcbintegration.cpp | |
parent | 787692a09ee3e7e224ddb36b2c602bc3c37e9fab (diff) |
Add public and QPA APIs for adapting existing OpenGL contexts
For now only xcb on GLX is supported. Other platforms will follow later.
Add also some missing documentation for the platform OpenGL context factory
functions.
[ChangeLog] QOpenGLContext is now able to adopt existing native contexts.
Task-number: QTBUG-37552
Change-Id: I5dd959f102df178f646b2df5989203b5dc6de376
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbintegration.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbintegration.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 0bab341914..2d4c523a4b 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -233,7 +233,10 @@ QPlatformOpenGLContext *QXcbIntegration::createPlatformOpenGLContext(QOpenGLCont { QXcbScreen *screen = static_cast<QXcbScreen *>(context->screen()->handle()); #if defined(XCB_USE_GLX) - return new QGLXContext(screen, context->format(), context->shareHandle()); + QGLXContext *platformContext = new QGLXContext(screen, context->format(), + context->shareHandle(), context->nativeHandle()); + context->setNativeHandle(platformContext->nativeHandle()); + return platformContext; #elif defined(XCB_USE_EGL) return new QEGLXcbPlatformContext(context->format(), context->shareHandle(), screen->connection()->egl_display(), screen->connection()); |