diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/rhi/qrhigles2.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/rhi/qrhigles2.cpp b/src/gui/rhi/qrhigles2.cpp index 139375fbec..9a311101e1 100644 --- a/src/gui/rhi/qrhigles2.cpp +++ b/src/gui/rhi/qrhigles2.cpp @@ -413,6 +413,10 @@ bool QRhiGles2::create(QRhi::Flags flags) if (!importedContext) { ctx = new QOpenGLContext; ctx->setFormat(requestedFormat); + if (QOpenGLContext *shareContext = qt_gl_global_share_context()) { + ctx->setShareContext(shareContext); + ctx->setScreen(shareContext->screen()); + } if (!ctx->create()) { qWarning("QRhiGles2: Failed to create context"); delete ctx; |