[osg-users] setUpViewerAsEmbeddedInWindow question

Serge Lages 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
> model.
> 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...
> Robert.
> 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.
> And
> > we have some questions concerning the
> method  setUpViewerAsEmbeddedInWindow.
> >
> >  First of all, what is its real purpose ? Can it be used as a proper way
> to
> > 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
> illusion
> > by putting an OSG window at the place where the container should be. Or
> have
> > 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
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Serge Lages
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20070904/e6e0f901/attachment-0003.htm>

More information about the osg-users mailing list