diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2010-08-06 13:23:06 +0200 |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2010-08-06 13:23:06 +0200 |
commit | 783f218aac7c73837405af4893d8dd35b425a710 (patch) | |
tree | d5836edc22a9dd867e426778c93b80ed12d1154d /src/opengl/qgl_qpa.cpp | |
parent | 4a0ecee1fca85468c1cbcf8abb68f3d066ca4f60 (diff) |
Fixed Lighthouse tempcontext to reset to current context
and made glxintegrations shared context use the correct window
configuration
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 b05df6417c..ad125fec1d 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; } |