Using FBO Created with QT

Hello,

is it possible to render in frame buffer object created with QT?

I'm trying to create a FBO using QOpenGLFrameBuffer object and I bind to the context. The QT openGL context is created using the native context created by OCCT.

now if I check the current bound frame buffer before and after a view_->redraw() , the value is not the same

glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &drawFboId);
if(!view_.IsNull())
    view_->Redraw();
glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &drawFboId);

 

if I check the value of drawFboId before and after, the value is different (  before is different from zero, after is zero ).

 

The result of this behaviour is that the image obtained from the FBO is not correct ( a black rectangle ).

How can I use the FBO created with QT to render OCCT?

thank you

 

 

 

 

 

 

 

 

 

Kirill Gavrilov's picture

Rendering OCCT 3D Viewer into Qt framebuffer is possible - for this OpenGl_FrameBuffer::InitWrapper() allows wrapping an existing OpenGL object.
But implementing this connection is tricky.

Ivan's picture

Thank you Kirill for the response,

the same software worked with occt 6.8. What is different with version 7.4?

Kirill Gavrilov's picture

It might worked somehow because OCCT used off-screen frame buffers only for image dump, and since OCCT 6.9.0 they are used for a regular rendering to provide/improve functionality/performance.