diff options
Diffstat (limited to 'src/opengl/qgl_qpa.cpp')
-rw-r--r-- | src/opengl/qgl_qpa.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/opengl/qgl_qpa.cpp b/src/opengl/qgl_qpa.cpp index cfd651e39d..e6c135bb7f 100644 --- a/src/opengl/qgl_qpa.cpp +++ b/src/opengl/qgl_qpa.cpp @@ -150,13 +150,15 @@ bool QGLContext::chooseContext(const QGLContext* shareContext) delete d->guiGlContext; QGuiGLContext *shareGlContext = shareContext ? shareContext->d_func()->guiGlContext : 0; - d->guiGlContext = new QGuiGLContext(winFormat, shareGlContext); + d->guiGlContext = new QGuiGLContext; + d->guiGlContext->setFormat(winFormat); + d->guiGlContext->setShareContext(shareGlContext); + d->valid = d->guiGlContext->create(); - d->glFormat = QGLFormat::fromSurfaceFormat(d->guiGlContext->format()); - d->valid = d->guiGlContext->isValid(); - if (d->valid) { + if (d->valid) d->guiGlContext->setQGLContextHandle(this,qDeleteQGLContext); - } + + d->glFormat = QGLFormat::fromSurfaceFormat(d->guiGlContext->format()); d->setupSharing(); } @@ -300,6 +302,7 @@ QGLTemporaryContext::QGLTemporaryContext(bool, QWidget *) d->window->create(); d->context = new QGuiGLContext; + d->context->create(); d->context->makeCurrent(d->window); } |