summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl_qpa.cpp
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2010-08-06 13:23:06 +0200
committerJørgen Lind <jorgen.lind@nokia.com>2010-08-06 13:23:06 +0200
commit783f218aac7c73837405af4893d8dd35b425a710 (patch)
treed5836edc22a9dd867e426778c93b80ed12d1154d /src/opengl/qgl_qpa.cpp
parent4a0ecee1fca85468c1cbcf8abb68f3d066ca4f60 (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.cpp13
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;
}