Ported following examples to osgViewer:

osgparticleeffects
osgphotoalbum
osgpick
osgpoints
osgpointsprite
osgprecipitation
osgprerender
osgprerendercubemap
osgreflect
osgscalarbar
osgscribe
osgsequence
osgplanets
This commit is contained in:
Robert Osfield
2007-01-10 13:52:22 +00:00
parent c5082cb85c
commit c4279bd5f1
57 changed files with 290 additions and 883 deletions

View File

@@ -5,11 +5,13 @@
#include <osg/Geometry>
#include <osg/Texture2D>
#include <osg/TexEnv>
#include <osgDB/ReadFile>
#include <osgProducer/Viewer>
#include <osg/GLExtensions>
#include <osg/TexEnv>
#include <osgDB/ReadFile>
#include <osgViewer/Viewer>
osg::Geode *makeGalaxy(unsigned nvertices)
{
osg::Geode *geode = new osg::Geode();
@@ -75,33 +77,15 @@ osg::StateSet* makeStateSet(float size)
int main(int, char *[])
{
osgProducer::Viewer viewer;
osgViewer::Viewer viewer;
/// Make the galaxy of points
osg::Node *node = makeGalaxy(5000);
node->setStateSet(makeStateSet(10.0f));
viewer.setUpViewer(osgProducer::Viewer::STANDARD_SETTINGS);
viewer.setSceneData(node);
viewer.realize();
while (!viewer.done())
{
viewer.sync();
viewer.update();
viewer.frame();
}
// wait for all cull and draw threads to complete.
viewer.sync();
// run a clean up frame to delete all OpenGL objects.
viewer.cleanup_frame();
// wait for all the clean up frame to complete.
viewer.sync();
return(0);
return viewer.run();
}