aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-06-11 15:32:53 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-06-12 12:38:39 +0200
commit9943181dcc9e2b0de630669219edcaf62956c1f1 (patch)
treee9535243cbaf755cac734a9880e6aa3c9bee17ca /examples
parent69c7ed97c2dde8b45cc29d08eb4568dc08fcd00a (diff)
Move resetOpenGLState() to QQuickFbo
QQuickWindow should not have OpenGL specifics in its API in Qt 6. However, resetOpenGLState() is used by applications commonly in combination with QQuickFramebufferObject (not the least because the documentation recommends it!). This is no problem in practice because QQuickFramebufferObject remains an OpenGL-only feature. So to minimize the breaks, move the function into QQuickFramebufferObject::Renderer so any application that calls the function can continue to do so by just calling it on 'this' instead. The rendercontrol_opengl example used to call this function as well, but unnecessarily, it will still function the same way without it. Note that there is a chance that there are applications that call resetOpenGLState() in other contexts, for example in slots connected to before or afterRendering(). For these it will need to be determined if the call is necessary at all, and if it is, should be replaced by (re)setting the appropriate OpenGL state manually instead. Task-number: QTBUG-84523 Change-Id: I335599f77e8a84e347a44427eb1a1bf917796ee8 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.cpp b/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.cpp
index 9435c004a7..0d29a155dd 100644
--- a/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.cpp
+++ b/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.cpp
@@ -206,9 +206,7 @@ void WindowSingleThreaded::render()
m_renderControl->render();
m_renderControl->endFrame();
- m_quickWindow->resetOpenGLState();
QOpenGLFramebufferObject::bindDefault();
-
m_context->functions()->glFlush();
m_quickReady = true;