Hi Martin,
I am actually trying to get both working: An osg widget in a Qt window that has a Qt HUD :O
Have you looked at GraphicsWindowQt in the osgViewerQtContext example in current SVN trunk? I'm curious to hear of any impressions.
About QGraphicsViewAdapter: If I understand it correctly, the Qt widgets are rendered to a triple-buffered image in main memory. That image is then used in the OSG thread as a texture.
Yep.
The WolfenQt example uses OpenGL to paint the widgets directly onto the 3d scene. It does not run in a different thread,
Yes, but then that example also does straight OpenGL rendering without the benefits of a scene graph. This is fine for simple scenes like in that example, but breaks down when you have very complex scenes. Also when rendering to multiple viewports / windows / contexts, or rendering multiple scenes that can be culled independently, then having multiple culling / rendering threads is very helpful. OSG does all this automatically for you, so I really want to try and impede its work as little as I can. In particular I don't want to block its rendering thread(s) at any time.
but I don't think Qt painting is CPU intensive.
That's my current assumption, and it seems to be holding. Interaction with the Qt widgets in the OSG scene is a bit sluggish (you can already see this in the osgQtBrowser example) but it doesn't matter that much.
Eventually I think there would be a way of combining the two - i.e. if the user has a GraphicsWindowQt (which uses QGLWidget under the hood) then Qt should be able to use its OpenGL backend to draw the widgets under QGraphicsViewAdapter straight into the OpenGL context instead of having an intermediate texture. But that's thinking further ahead than what I need for now.
J-S -- ______________________________________________________ Jean-Sebastien Guay [email protected] http://www.cm-labs.com/ http://whitestar02.webhop.org/ _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
