[osg-users] setUpViewerAsEmbeddedInWindow question
serge.lages at gmail.com
Tue Sep 4 06:02:28 PDT 2007
Thank you Robert for this quick reply, it seems that it can fit our needs,
now it's time to try. :)
On 9/4/07, Robert Osfield <robert.osfield at gmail.com> wrote:
> Hi Serge,
> View::setUpViewerAsEmbeddedInWindow() creates a
> osgViewer::GraphicsWindowEmbedded and attaches it to Viewer's master
> Camera. This GraphicsWindowEmbedded just does a non op for all the
> operations like makeCurrent(), swap buffer etc. It quite literally
> fakes it, osgViewer::Viewer treats it like an ordinary window, but of
> course it isn't - so there are real limitations to what you can do,
> but if you use it in a restricted way it'll work just fine.
> GraphicsWindowEmbedded is the trick used to allow
> osgViewer::Viewer/CompositeViewer work in a way that their weren't
> originally designed for. I never really expected to be able to cover
> this type of embedded usage model with classes like powerful viewer
> classes Viewer and CompositeViewer, but the trick allows us to get
> away with reuse a great deal of the viewer functionality, and avoid
> the need for extra viewer classes just to support one type of usage
> The restrictions associate with use GraphicsWindowEmbedded is that the
> viewer must be run single threaded, and that there is only a single
> GraphicsWindowEmbedded attached to the Viewer, and that the calling
> application must create the graphics context itself, do make current
> and swap buffers and cleanup and pass on actual window resizes.
> The advantage that we gain is that you can use one viewer API to cover
> the full range of viewer usage models - embedded, osgViewer inbuilt
> GraphicsWindows, or API specific GraphicsWindow implementations, or
> window inheritance. The fact that its the same API means that your
> app code will be easily portable between these different usage models.
> So one day you can stick your viewer in browser, the next you can do
> it in cave, the next on normal desktop application, the next on
> spherical display, the next on stereo monitor...
> On 9/4/07, Serge Lages <serge.lages at gmail.com> wrote:
> > Hi Robert and all,
> > We are currently looking to embed an OSG viewer into several containers.
> > we have some questions concerning the
> method setUpViewerAsEmbeddedInWindow.
> > First of all, what is its real purpose ? Can it be used as a proper way
> > embed the viewer, or is it more a "cheap" alternative to do it ? And is
> > there any major problems that can rise by using it ?
> > If I understand it well, it works as a fake embedding, making this
> > by putting an OSG window at the place where the container should be. Or
> > I missed something ?
> > Many thanks in advance for your help !
> > --
> > Serge Lages
> > http://www.magrathea-engine.org
> > _______________________________________________
> > osg-users mailing list
> > osg-users at lists.openscenegraph.org
> osg-users mailing list
> osg-users at lists.openscenegraph.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the osg-users