QQuickFramebufferObject and offscreen rendering
I'm working with a project that uses QQuickFramebufferObject and QQuickFrambufferObject::Renderer classes to render to the screen. I'm wondering if there are any examples which show how to do offscreen rendering using QQuickFramebufferObject?
I've tried a few approaches -- either a manually-created FBO or a QT-abstracted FBO (like creating a separate QQuickFramebufferObject or a QOpenGLFrameBufferObject), and I run into a problem when I unbind that offscreen FBO (so that I can render to the normal frame buffer). Specifically, I get a solid blue framebuffer on-screen that shows nothing else.
Since I'm not allowed to share this code I was wondering if anyone has done offscreen rendering with QQuickFramebufferObject. The examples I find use the QOpenGLWidget pattern instead.
Here's an attempt of me trying to do so (using the fboinsgrenderer example):
There is a section of the code where I try to use an offscreen buffer, commented out because it causes the normal frame buffer to render as blue:
// uncomment this block of code to see an incorrect rendering
I don't know why I can't seem to use an offscreen fbo with a QtQuickFramebufferObject renderer.