[Qt-interest] QGLFramebufferObject: rendering off-screen without QGLWidget?

Christos Stamatopoulos xstamatopoulos at gmail.com
Tue Dec 30 10:03:16 CET 2008


I guess i am trying to do something similar with you and some help would  
be great ! I have a scene that i draw using opengl and i want to grab  
screenshots of it but actually high resolution ones as i want to generate  
synthetic images. So the use of a framebuffer object from what i read is  
needed. Just for the record the actual application is a camera simulator  
so the size of the FBo can vary depending on what i want to simulate.
Anyway, i have a scene that i render to a qglwidget and then i just want  
to render the same scene to my FBo so i can save it in the desired as i  
can have a bigger Viewport there (my card supports FBo up to 4096x4096)   
but when debugging it actually fails in bind() and i still dont understand  
why cause theoretically i got a curent context in the qglwidget...but i am  
new to opengl so any information would be more than helpful.
What i found in the end is that if the widget does not have a parent  
everything is ok ... But mine is the central widget in a qmainwindow which  
is the problem as it seems.

To test this just take any framebuffer object example that the Trolls give  
and put it in a qmainwindow. The app will crash if you run and if you  
debug you will see that the bind() fails. Why does this happen ? And is  
there any workarround ?

I know that this started more as a performance test for you but i dont  
really care to be honest. I just wanna know why it fails and how i can fix  
it !

Thank you in advance !

PS. I had a similar post before until i saw this one. THey are not exactly  
the same as this one was focusing in the perfomance and mine is simply  
asking why does the fbo fails when you put it in a qmainwindow. I  am  
sorry in case this is a problem.



More information about the Qt-interest-old mailing list