diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2010-08-06 11:23:06 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2010-08-06 11:23:06 (GMT) |
commit | 783f218aac7c73837405af4893d8dd35b425a710 (patch) | |
tree | d5836edc22a9dd867e426778c93b80ed12d1154d /src/opengl | |
parent | 4a0ecee1fca85468c1cbcf8abb68f3d066ca4f60 (diff) | |
download | Qt-783f218aac7c73837405af4893d8dd35b425a710.zip Qt-783f218aac7c73837405af4893d8dd35b425a710.tar.gz Qt-783f218aac7c73837405af4893d8dd35b425a710.tar.bz2 |
Fixed Lighthouse tempcontext to reset to current context
and made glxintegrations shared context use the correct window
configuration
Diffstat (limited to 'src/opengl')
-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 b05df64..ad125fe 100644 --- a/src/opengl/qgl_qpa.cpp +++ b/src/opengl/qgl_qpa.cpp @@ -244,20 +244,23 @@ void QGLContext::generateFontDisplayLists(const QFont & fnt, int listBase) class QGLTemporaryContextPrivate { public: - QWidget *widget; + QGLWidget *widget; + QGLContext *context; }; QGLTemporaryContext::QGLTemporaryContext(bool, QWidget *) : d(new QGLTemporaryContextPrivate) { - d->widget = new QWidget; - d->widget->setGeometry(0,0,3,3); - d->widget->winId(); - d->widget->platformWindow()->glContext()->makeCurrent(); + d->context = const_cast<QGLContext *>(QGLContext::currentContext()); + d->context->doneCurrent(); + d->widget = new QGLWidget; + d->widget->makeCurrent(); } QGLTemporaryContext::~QGLTemporaryContext() { + d->widget->doneCurrent(); + d->context->makeCurrent(); delete d->widget; } |