Added osgViewer path into osgviewer, old osgProducer version remains accessible

via --osgProducer command line option
This commit is contained in:
Robert Osfield 2007-01-12 10:26:49 +00:00
parent 041482ca46
commit 5b0e78783a
4 changed files with 33 additions and 8 deletions

View File

@ -369,6 +369,9 @@ Package=<4>
Project_Dep_Name Core osgProducer
End Project Dependency
Begin Project Dependency
Project_Dep_Name Core osgViewer
End Project Dependency
Begin Project Dependency
Project_Dep_Name Core osgUtil
End Project Dependency
}}}

View File

@ -4,7 +4,7 @@ include $(TOPDIR)/Make/makedefs
CXXFILES =\
osgviewer.cpp\
LIBS += -losgProducer -lProducer -losgText -losgGA -losgDB -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)
LIBS += -losgViewer -losgProducer -lProducer -losgText -losgGA -losgDB -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)
INSTFILES = \
$(CXXFILES)\

View File

@ -4,7 +4,7 @@ include $(TOPDIR)/Make/makedefs
CXXFILES =\
osgviewer.cpp\
LIBS += -losgProducer -lProducer -losgDB -losgText -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)
LIBS += -losgViewer -losgProducer -lProducer -losgDB -losgText -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)
EXEC = osgviewer

View File

@ -11,15 +11,11 @@
#include <osgDB/ReadFile>
#include <osgUtil/Optimizer>
#include <osgProducer/Viewer>
#include <osg/CoordinateSystemNode>
int main( int argc, char **argv )
#include <osgProducer/Viewer>
int main_osgProducer(osg::ArgumentParser& arguments)
{
// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv);
// set up the usage document, in case we need to print out how to use this program.
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the standard OpenSceneGraph example which loads and visualises 3d models.");
@ -128,3 +124,29 @@ int main( int argc, char **argv )
return 0;
}
#include <osgViewer/Viewer>
int main_osgViewer(osg::ArgumentParser& arguments)
{
osgViewer::Viewer viewer;
viewer.setSceneData( osgDB::readNodeFiles(arguments));
return viewer.run();
}
int main( int argc, char **argv )
{
// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv);
if (arguments.read("--osgProducer"))
{
return main_osgProducer(arguments);
}
else
{
return main_osgViewer(arguments);
}
}