update problem with legacy Qt5 OpenGL code fixed

This commit is contained in:
Uwe Rathmann 2023-12-28 16:29:29 +01:00
parent a79650a76e
commit ccb79967f4
1 changed files with 14 additions and 1 deletions

View File

@ -51,7 +51,20 @@ namespace
#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) #if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
inline int textureId() const { return m_fbo ? m_fbo->texture() : 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 #endif
inline QRhiTexture* rhiTexture() const { return m_rhiTexture; } inline QRhiTexture* rhiTexture() const { return m_rhiTexture; }