[osg-users] OperationsThread(OSG 2.0) example

Robert Osfield robert.osfield at gmail.com
Wed Apr 2 03:03:14 PDT 2008


HI Rahul,

The GraphicsContext "has a" osg::GraphicsThreads, and
osg::GraphicsThread subclasses from osg::OperationThread.  There is
also the osg::GraphicsOperation that can be used in place on
osg::Operation as this gives you the graphics context as a functor
parameters.

One thing to be aware of w.r.t GraphicsThreads's operation list is
that osgViewer itself will set it up.  There is a operation list in
GraphicsContext that you could probably leverage though.

Robert.

On Wed, Apr 2, 2008 at 10:44 AM, Rahul Srivastava <rahul at darshan3d.com> wrote:
> Hi Robert,
>
>  I looked at the Viewer code also but could not figure out how to make
>  Operation work without the graphics context. Here's a sample program I
>  wrote. Is there something wrong with what I'm doing?
>
>  The program seems to wait for a condition at the line "t->add(...)" and
>  doesn't respond.
>
>  --snip--
>
>  OpenThreads::Thread::Init();
>
>  osg::ref_ptr<osg::OperationsThread> t = new osg::OperationsThread;
>
>  osg::ref_ptr<osg::Operation> o = new TestOperation;
>
>  t->add(o.get(), false);
>
>  t->startThread();
>
>  --snip--
>
>  Regards,
>
>  --
>
> Rahul Srivastava,
>  Member of Technical Staff,
>  Visualization Experts Limited.
>  www.vizexperts.com
>  +91-98738-85880 (M)
>
>
>
>
>
> Robert Osfield wrote:
>  > HI Rahul,
>  >
>  > grep is your friend...
>  >
>  >
>  >> grep "osg::Operation" examples/*/*.cpp -l
>  >>
>  > examples/osgcatch/osgcatch.cpp
>  > examples/osgmotionblur/osgmotionblur.cpp
>  > examples/osgterrain/osgterrain.cpp
>  > examples/osgtext/osgtext.cpp
>  >
>  >
>  > You'll also find OperationThread and custom Operations in action in
>  > VirtualPlanetBuilder.
>  >
>  > osgViewer also makes use of them.
>  >
>  > Robert.
>  >
>  > On Tue, Apr 1, 2008 at 6:49 AM, Rahul Srivastava <rahul at darshan3d.com> wrote:
>  >
>  >> Hi Robert,
>  >>
>  >>  Is there an example for using OperationsThread/Operation for OSG 2.0? I
>  >>  tried looking at the GraphicsContext source which uses a graphicsThread
>  >>  but could not figure out how it used the operations thread.
>  >>
>  >>  --
>  >>  Rahul Srivastava,
>  >>  Member of Technical Staff,
>  >>  Visualization Experts Limited.
>  >>  www.vizexperts.com
>  >>  +91-98738-85880 (M)
>  >>
>  >>  _______________________________________________
>  >>  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
>  >
>  _______________________________________________
>  osg-users mailing list
>  osg-users at lists.openscenegraph.org
>  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>


More information about the osg-users mailing list