Hi Robert,
I see, thanks. However there is some strange behaviour
with the osgText using the State.
If I use the state retrieved from
dynamic_cast<osgViewer::Renderer*>(getCamera()->getRenderer())->getSceneView(0)->getState();
the text drawable is rendered. However If I use the
State given back by the graphic context the text is
sometimes (or most of the time) is not rendered.
I have to investigate why this happens. Maybe you have
some ideas?
Cheers,
Art
--- Robert Osfield <[EMAIL PROTECTED]> schrieb:
> HI Art,
>
> As osg::GraphicsContext "has a" osg::State object,
> while the
> Viewer/Composite class "has a" collections one or
> more
> GraphicsContexts virtue of the Cameras that they
> maintain. The viewer
> classes have a convenience method
> getContexts(ViewerBase:Contexts&)
> which you can use to get the contexts. i.e.
>
> Viewer::Contexts contexts;
> viewer.getContexts(contexts);
> for(Viewer::Contexts::iterator itr =
> contexts.begin();
> itr != contexts.end();
> ++itr)
> {
> osg::GraphicsContext* context = *itr;
> osg::State* state = context->getState();
> // do with me what you will
> }
>
>
>
> On Mon, Mar 10, 2008 at 3:39 PM, Art Tevs
> <[EMAIL PROTECTED]> wrote:
> > Hi folks,
> >
> > imagine I have a class derived from
> osgViewer::Viewer.
> > No I need the correct osg::State to apply
> something.
> > Where to get it from?
> >
> >
> > 1. One solution could be:
> >
>
dynamic_cast<osgViewer::Renderer*>(getCamera()->getRenderer())->getSceneView(0)->getState();
> >
> > however this state seems not to be initialized
> and I
> > have manually to call the
> initializeExtensionProcs()
> > method. And this seems not to be elegant
> solution.
> >
> >
> > 2. Second solution could be:
> > _currentContext->getState();
> >
> > however _currentContext seems to be NULL during
> the
> > run of osgViewer::Viewer.
> >
> >
> > Hence where to get the correct state from? I do
> not
> > have any SceneView or similar things defined,
> just the
> > customized viewer.
> >
> >
> > Best regards,
> > Art
> >
> >
> >
> >
> >
> > Machen Sie Yahoo! zu Ihrer Startseite. Los
> geht's:
> > http://de.yahoo.com/set
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> >
>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> _______________________________________________
> osg-users mailing list
> [email protected]
>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
Lesen Sie Ihre E-Mails auf dem Handy.
www.yahoo.de/go
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org