diff options
author | Gunnar Sletta <gunnar.sletta@jollamobile.com> | 2015-03-31 16:14:14 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2015-04-21 21:07:36 +0000 |
commit | 50fcdfd705c2ad9560641986bf4152b017ee8bb6 (patch) | |
tree | c1a14d4adeb7ec8f28b54c4898f6e629ae4d2fc5 /examples | |
parent | 1401a2ef0a00458d6d6677cacd32af6ad0440f55 (diff) | |
download | qtdeclarative-50fcdfd705c2ad9560641986bf4152b017ee8bb6.tar.gz qtdeclarative-50fcdfd705c2ad9560641986bf4152b017ee8bb6.tar.bz2 qtdeclarative-50fcdfd705c2ad9560641986bf4152b017ee8bb6.zip |
Include QQuickWindow::resetOpenGLState() in OpenGL under QML example.
Change-Id: Ieae110475dfb3f91d68919c7075054b5400f9e73
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/quick/scenegraph/openglunderqml/squircle.cpp | 5 | ||||
-rw-r--r-- | examples/quick/scenegraph/openglunderqml/squircle.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/examples/quick/scenegraph/openglunderqml/squircle.cpp b/examples/quick/scenegraph/openglunderqml/squircle.cpp index 8ef975c5b..2834b93e1 100644 --- a/examples/quick/scenegraph/openglunderqml/squircle.cpp +++ b/examples/quick/scenegraph/openglunderqml/squircle.cpp @@ -97,6 +97,7 @@ void Squircle::sync() } m_renderer->setViewportSize(window()->size() * window()->devicePixelRatio()); m_renderer->setT(m_t); + m_renderer->setWindow(window()); } //! [9] @@ -156,5 +157,9 @@ void SquircleRenderer::paint() m_program->disableAttributeArray(0); m_program->release(); + + // Not strictly needed for this example, but generally useful for when + // mixing with raw OpenGL. + m_window->resetOpenGLState(); } //! [5] diff --git a/examples/quick/scenegraph/openglunderqml/squircle.h b/examples/quick/scenegraph/openglunderqml/squircle.h index f797d7a7a..28016def4 100644 --- a/examples/quick/scenegraph/openglunderqml/squircle.h +++ b/examples/quick/scenegraph/openglunderqml/squircle.h @@ -50,6 +50,7 @@ public: void setT(qreal t) { m_t = t; } void setViewportSize(const QSize &size) { m_viewportSize = size; } + void setWindow(QQuickWindow *window) { m_window = window; } public slots: void paint(); @@ -58,6 +59,7 @@ private: QSize m_viewportSize; qreal m_t; QOpenGLShaderProgram *m_program; + QQuickWindow *m_window; }; //! [1] |