diff options
Diffstat (limited to 'examples/opengl/hellowindow/hellowindow.cpp')
-rw-r--r-- | examples/opengl/hellowindow/hellowindow.cpp | 4 |
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); |