summaryrefslogtreecommitdiffstats
path: root/examples/opengl/hellowindow/hellowindow.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-12-06 12:54:16 +0100
committerQt by Nokia <qt-info@nokia.com>2011-12-06 20:14:10 +0100
commite68642fe1003467f1483dd8ddb2528cd3136042e (patch)
treedca602bb464398412c853f90aed000eb7ad38dc1 /examples/opengl/hellowindow/hellowindow.cpp
parente838cf644fe482d0ff04f2a32f081bc4b6e30297 (diff)
Added multi-screen support to hellowindow example.
Change-Id: I025de342952bffeffa0705eb4cfcf869f32241cc Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Diffstat (limited to 'examples/opengl/hellowindow/hellowindow.cpp')
-rw-r--r--examples/opengl/hellowindow/hellowindow.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/opengl/hellowindow/hellowindow.cpp b/examples/opengl/hellowindow/hellowindow.cpp
index 2903ddd743..742de251f4 100644
--- a/examples/opengl/hellowindow/hellowindow.cpp
+++ b/examples/opengl/hellowindow/hellowindow.cpp
@@ -46,11 +46,13 @@
#include <qmath.h>
-Renderer::Renderer(const QSurfaceFormat &format, Renderer *share)
+Renderer::Renderer(const QSurfaceFormat &format, Renderer *share, QScreen *screen)
: m_initialized(false)
, m_format(format)
{
m_context = new QOpenGLContext(this);
+ if (screen)
+ m_context->setScreen(screen);
m_context->setFormat(format);
if (share)
m_context->setShareContext(share->m_context);