Hi Prasad,

You can do the multi-threading in any way you, you can even thread the main
loop out into a separate thread, or you can even just use the OSG's database
pager if to create procedural scene graph elements.  You have lots of
choice.  You don't really say enough about your apps needs to say what
approach is best for you.

Robert.

On Mon, Sep 14, 2009 at 3:50 PM, Prasad Pokala <[email protected]>wrote:

> Hi,
>
>
> Hi,
>
>    I am new to OSG.  I have a following code inside my c++ application to
> run OSGViewer.
>
>     osg::Group* root;
>     osgViewer::Viewer viewer;
>     root = new osg::Group();
>        ........
>        .........  ( setting up the viewer/adding geometry).
>
>   root->getOrCreateStateSet()->setMode(GL_LIGHTING,
> osg::StateAttribute::OFF);
>        viewer.setSceneData( root );
>        viewer.realize();
>        viewer.run();
>
>       //  wants to continue with my c++ stuff
>       //  some c++ code here
>     int p;
>    function1();
>       ........
>       ........
>
>
>  By above code I have added some triangles to the scene. and able to run
> the osgviewer. After running  the osgviewer I am unable to reach to
> function1(); untill and unless i close the osgviewer. Seems like osgviewer
> is runnig in singlethread and its not allowing me to do anything else.
>
> After I displayed the osgviewer I want to continue with my c++ stuff with
> background osgviewer is running.
>
> I guess I have to implement some multithreading to run viewer as well as to
> continue with  c++ stuff.
>
> Any one has some idea how can i do this??
>
>
>
> Thank you!
>
> Cheers,
> Prasad
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=17343#17343
>
>
>
>
>
> _______________________________________________
> 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

Reply via email to