On Thu, 2007-01-25 at 09:15 +0000, Robert Osfield wrote: > Hi Jeremy, As always, thanks for the great and thorough response. :)
> As you've found out SimpleViewer is just that its simple, the single > Camera associated without doesn't manage a GraphicsWindow like > osgViewer::Viewer and CompositeViewer do, it simply implements all the > rendering it needs via the local renderingTraversals() method. > > Right now the osgViewer::StatsHandler creates its own local > osg::Camera to do the stats HUD, and assigns the first available > GraphicsWindow that the viewer has to the Camera, and then tells the > viewer to updating its rendering support (in effect passing > GraphicsOperations that wrap SceneView to the GraphisWindow to be > rendered each frame). > > StatsHandler doesn't work with CompositeViewer yet, but potentially it > could as its local osg::Camera could reuse the the viewers > GraphicsWindow in the same way as the Viewer class. CompositeViewer > doesn't yet collect stats though so this is another little bit of work > to do. > > StatsHandlers obviously doesn't work with SimpleViewer either, and > here there isn't a GraphicsWindow to assign to its local Camera and > SimpleViewer itself doesn't collect any stats... So these are two > areas that would need to be coded to add stats support. > > What would be less coding would be to implement a GraphicsWindowGTK > with enough functionality that you could assign such a window to a > osgViewer::Viewer are then stats and everything else will work > straight off. I looked into this a bit after reading your response. Where does an osgViewer::Viewer object actually figure out what kind of GraphicsWindow* it needs? Is this something determined at compile-time? > SimpleViewer is not really intended to be an all single all dancing > viewer, its role is to make it quick to integrate with applications > that already have graphics windows setup and need to embed OSG into > it. But it's so easy to use! :) > osgViewer::Viewer and osgViewer::Composite can work with 3rd party > windowing libraries, but it requires a little more work, but the > rewards are greater for this work. > > Robert. > > On 1/24/07, Jeremy L. Moles <[EMAIL PROTECTED]> wrote: > > I'm cleaning up the osgsimpleviewerGTK demo (for resubmission) and I > > wanted to add the ability to toggle the stats display on/off. However, I > > realized the SimpleViewer object has no way of doing this, which led to > > a question: > > > > I've read the comments in the files, but I can't see the "conceptual" > > difference between the two. I can almost use them interchangeably, > > although osgViewer::Viewer doesn't actually "display" anything using the > > code that works for SimpleViewer. It would appear that the SimpleViewer > > class is much lower level than just the Viewer class, as it makes no > > attempt to create a window--only a context. > > > > At any rate--it should be very straightforward to add stats to > > SimpleViewer, right? How much interaction will it need (if any?) with > > the "external" windowing system--in my case, GTK? > > > > _______________________________________________ > > osg-users mailing list > > [email protected] > > http://openscenegraph.net/mailman/listinfo/osg-users > > http://www.openscenegraph.org/ > > > _______________________________________________ > osg-users mailing list > [email protected] > http://openscenegraph.net/mailman/listinfo/osg-users > http://www.openscenegraph.org/ > _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
