From de455222834e6b123a813fcad1064ff7d1991fc1 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 11 Jun 2020 14:44:07 +0200 Subject: openglunderqml example: remove unnecessary resetOpenGLState call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also request the OpenGL RHI backend explicitly, like all the other similar examples (d3d11underqml, and so on) do. Calling resetOpenGLState() in this example is pointless because it happens before returning from the custom rendering function, and the endExternalCommands() call achieves the same internally, i.e. the rhi will know that cached state cannot be used anymore. There are other valid uses cases for resetOpenGLState() but this example does not have those. Change-Id: Ifa7861b80c29c174d02cfe37fe8ef8eed7344195 Reviewed-by: Christian Strømme --- examples/quick/scenegraph/openglunderqml/main.cpp | 2 ++ examples/quick/scenegraph/openglunderqml/squircle.cpp | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'examples') diff --git a/examples/quick/scenegraph/openglunderqml/main.cpp b/examples/quick/scenegraph/openglunderqml/main.cpp index 4ca8d05f1c..c151af179e 100644 --- a/examples/quick/scenegraph/openglunderqml/main.cpp +++ b/examples/quick/scenegraph/openglunderqml/main.cpp @@ -59,6 +59,8 @@ int main(int argc, char **argv) { QGuiApplication app(argc, argv); + QQuickWindow::setSceneGraphBackend(QSGRendererInterface::OpenGLRhi); + QQuickView view; view.setResizeMode(QQuickView::SizeRootObjectToView); view.setSource(QUrl("qrc:///scenegraph/openglunderqml/main.qml")); diff --git a/examples/quick/scenegraph/openglunderqml/squircle.cpp b/examples/quick/scenegraph/openglunderqml/squircle.cpp index 1c4563baa5..d80309cbfb 100644 --- a/examples/quick/scenegraph/openglunderqml/squircle.cpp +++ b/examples/quick/scenegraph/openglunderqml/squircle.cpp @@ -202,10 +202,6 @@ 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(); - m_window->endExternalCommands(); } //! [5] -- cgit v1.2.3