summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/quick3d/imports/scene3d/scene3ditem.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/quick3d/imports/scene3d/scene3ditem.cpp b/src/quick3d/imports/scene3d/scene3ditem.cpp
index 04791ec03..ce21e7283 100644
--- a/src/quick3d/imports/scene3d/scene3ditem.cpp
+++ b/src/quick3d/imports/scene3d/scene3ditem.cpp
@@ -43,8 +43,8 @@
#include <QOpenGLContext>
#include <QOpenGLFramebufferObject>
#include <QOpenGLFramebufferObjectFormat>
-
#include <QSurface>
+#include <QQuickWindow>
#include <QSGSimpleTextureNode>
@@ -103,6 +103,14 @@ public:
Q_UNUSED(saver)
m_renderAspect->renderSynchronous();
+
+ // We may have called doneCurrent() so restore the context.
+ saver.context()->makeCurrent(saver.surface());
+
+ // Reset the state used by the Qt Quick scenegraph to avoid any
+ // interference when rendering the rest of the UI.
+ m_item->window()->resetOpenGLState();
+
update();
}