what is the best way to enable offscreen rendering for the V3d_View? (I´m using OCC in combination with Qt. And my constructor looks
like in this thread: http://www.opencascade.org/org/forum/thread_25450/?forum=3)
So far I have an init()-method where I initialize the FrameBufferObject:
Handle(Visual3d_View) visual3dView = m_view->View();
OpenGl_FrameBuffer *fboPtr = (OpenGl_FrameBuffer *) visual3dView->FBOCreate(width(), height());
const Graphic3d_CView *graphic3dCView = (const Graphic3d_CView *) visual3dView->CView();
const OpenGl_CView *openGlCView = (const OpenGl_CView *) graphic3dCView->ptrView;
Handle(OpenGl_Context) glContext = openGlCView->WS->GetGlContext(); // get glContext
Graphic3d_PtrFrameBuffer graphic3dFboPtr = (Graphic3d_PtrFrameBuffer) fboPtr;
visual3dView->FBOChangeViewport(graphic3dFboPtr, width(), height());
Then in the paint-method one should call visual3dView->BufferDump (Image_PixMap &theImage, const Graphic3d_BufferType &theBufferType).
But this approach does not seem to work (it crashes) !?
At first I tried to call visual3dView->FBOChangeViewport(...) from the paint-method() and not from the init-method() (like above). But then I noticed that the V3d_View() constantly autoupdates the window (e.g. after a call to Rotation(...)). But in my program only
rendering to a FrameBufferObject should be allowed, and every direct rendering call should be prevented (due to some odd error).
Thanks for any tips!