summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl_qpa.cpp
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2010-07-23 09:46:23 +0200
committerJørgen Lind <jorgen.lind@nokia.com>2010-07-23 13:28:36 +0200
commit699d74a9fae0b2d03e5c74bfb9590f6f0809ef4e (patch)
treeb5a5b787558e74497b84dbcd73ff614e7642630f /src/opengl/qgl_qpa.cpp
parentbe08fbc13f7370b6cc0c34660b4d1c16e4fdd3f5 (diff)
Make it possible to have shared contexts to Lighthouse
This adds a getter to QPlatformGLContext for the "default shared context". The setter is protected as it is the plugins responsibillity to create it or not. QPlatformWindowFormat has also gotten a pointer to a QPlatformGLContext for a non default shared context. Only implemented shared contexts in testlite for now.
Diffstat (limited to 'src/opengl/qgl_qpa.cpp')
-rw-r--r--src/opengl/qgl_qpa.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/opengl/qgl_qpa.cpp b/src/opengl/qgl_qpa.cpp
index aa124fe138..0fc885c3f5 100644
--- a/src/opengl/qgl_qpa.cpp
+++ b/src/opengl/qgl_qpa.cpp
@@ -66,6 +66,9 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
}else {
QWidget *widget = static_cast<QWidget *>(d->paintDevice);
if (!widget->platformWindow()){
+ QPlatformWindowFormat format = widget->platformWindowFormat();
+ format.setWindowApi(QPlatformWindowFormat::OpenGL);
+ widget->setPlatformWindowFormat(format);
widget->winId();//make window
}
d->platformContext = widget->platformWindow()->glContext();