From ccb79967f421c215efbe25808f57909a1292b6c6 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Thu, 28 Dec 2023 16:29:29 +0100 Subject: [PATCH] update problem with legacy Qt5 OpenGL code fixed --- src/nodes/QskSceneTexture.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/nodes/QskSceneTexture.cpp b/src/nodes/QskSceneTexture.cpp index 0b733b74..8c198816 100644 --- a/src/nodes/QskSceneTexture.cpp +++ b/src/nodes/QskSceneTexture.cpp @@ -51,7 +51,20 @@ namespace #if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) inline int textureId() const { return m_fbo ? m_fbo->texture() : 0; } - inline void renderScene() { Inherited::renderScene( textureId() ); } + + inline void renderScene() + { + class Bindable : public QSGBindable + { + public: + Bindable( QOpenGLFramebufferObject* fbo ) : m_fbo( fbo ) {} + void bind() const override { m_fbo->bind(); } + private: + QOpenGLFramebufferObject* m_fbo; + }; + + Inherited::renderScene( Bindable( m_fbo ) ); + } #endif inline QRhiTexture* rhiTexture() const { return m_rhiTexture; }