openglunderqml example: remove unnecessary resetOpenGLState call
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 <christian.stromme@qt.io>
This commit is contained in:
parent
8603a0177a
commit
de45522283
|
@ -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"));
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue