diff --git a/VisualStudio/OpenSceneGraph.dsw b/VisualStudio/OpenSceneGraph.dsw index 2b6769e06..4dbef90b6 100644 --- a/VisualStudio/OpenSceneGraph.dsw +++ b/VisualStudio/OpenSceneGraph.dsw @@ -531,7 +531,7 @@ Package=<4> Project_Dep_Name Core osgGA End Project Dependency Begin Project Dependency - Project_Dep_Name Core osgProducer + Project_Dep_Name Core osgViewer End Project Dependency Begin Project Dependency Project_Dep_Name Core osgUtil diff --git a/VisualStudio/examples/osgcallback/osgcallback.dsp b/VisualStudio/examples/osgcallback/osgcallback.dsp index 4ca8cb6f8..bfaec1498 100755 --- a/VisualStudio/examples/osgcallback/osgcallback.dsp +++ b/VisualStudio/examples/osgcallback/osgcallback.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Target_Dir "" MTL=midl.exe # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "../../../include" /I "../../../../OpenThreads/include" /I "../../../../Producer/include" /I "../../../../3rdParty/include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_CRT_SECURE_NO_DEPRECATE" /YX /FD /Zm200 /c +# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "../../../include" /I "../../../../OpenThreads/include" /I "../../../../3rdParty/include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_CRT_SECURE_NO_DEPRECATE" /YX /FD /Zm200 /c # ADD BASE RSC /l 0x809 /d "NDEBUG" # ADD RSC /l 0x809 /d "NDEBUG" BSC32=bscmake.exe @@ -51,7 +51,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 OpenThreadsWin32.lib /nologo /subsystem:console /debug /machine:I386 /opt:ref /opt:icf /out:"$(OutDir)/osgcallback.exe" /libpath:"../../../lib/$(PlatformName)" /libpath:"../../../../OpenThreads/lib/$(PlatformName)" /libpath:"../../../../Producer/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib" +# ADD LINK32 OpenThreadsWin32.lib /nologo /subsystem:console /debug /machine:I386 /opt:ref /opt:icf /out:"$(OutDir)/osgcallback.exe" /libpath:"../../../lib/$(PlatformName)" /libpath:"../../../../OpenThreads/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib" !ELSEIF "$(CFG)" == "Example osgcallback - Win32 Debug" @@ -68,7 +68,7 @@ LINK32=link.exe # PROP Target_Dir "" MTL=midl.exe # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /Zi /Od /I "../../../include" /I "../../../../OpenThreads/include" /I "../../../../Producer/include" /I "../../../../3rdParty/include" /D "_CONSOLE" /D "_MBCS" /D "FL_DLL" /D "WIN32" /D "_DEBUG" /D "_CRT_SECURE_NO_DEPRECATE" /FR /YX /FD /Zm200 /c +# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /Zi /Od /I "../../../include" /I "../../../../OpenThreads/include" /I "../../../../3rdParty/include" /D "_CONSOLE" /D "_MBCS" /D "FL_DLL" /D "WIN32" /D "_DEBUG" /D "_CRT_SECURE_NO_DEPRECATE" /FR /YX /FD /Zm200 /c # ADD BASE RSC /l 0x809 /d "_DEBUG" # ADD RSC /l 0x809 /d "_DEBUG" BSC32=bscmake.exe @@ -76,7 +76,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 OpenThreadsWin32d.lib glu32.lib opengl32.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"libcmt" /out:"$(OutDir)/osgcallbackd.exe" /pdbtype:sept /libpath:"../../../lib/$(PlatformName)" /libpath:"../../../../OpenThreads/lib/$(PlatformName)" /libpath:"../../../../Producer/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib" +# ADD LINK32 OpenThreadsWin32d.lib glu32.lib opengl32.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"libcmt" /out:"$(OutDir)/osgcallbackd.exe" /pdbtype:sept /libpath:"../../../lib/$(PlatformName)" /libpath:"../../../../OpenThreads/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib" # SUBTRACT LINK32 /incremental:no !ENDIF diff --git a/examples/osgcallback/GNUmakefile b/examples/osgcallback/GNUmakefile index 05a66d0e6..4dd3f954f 100644 --- a/examples/osgcallback/GNUmakefile +++ b/examples/osgcallback/GNUmakefile @@ -4,7 +4,7 @@ include $(TOPDIR)/Make/makedefs CXXFILES =\ osgcallback.cpp\ -LIBS += -losgProducer -lProducer -losgText -losgGA -losgDB -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS) +LIBS += -losgViewer -losgText -losgGA -losgDB -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS) INSTFILES = \ $(CXXFILES)\ diff --git a/examples/osgcallback/GNUmakefile.inst b/examples/osgcallback/GNUmakefile.inst index ad7e1dc45..b72119da8 100644 --- a/examples/osgcallback/GNUmakefile.inst +++ b/examples/osgcallback/GNUmakefile.inst @@ -4,12 +4,8 @@ include $(TOPDIR)/Make/makedefs CXXFILES =\ osgcallback.cpp\ -LIBS += -losgProducer -lProducer -losgDB -losgText -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS) +LIBS += -losgViewer -losgDB -losgText -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS) EXEC = osgcallback -INC += $(PRODUCER_INCLUDE_DIR) $(X_INC) -LDFLAGS += $(PRODUCER_LIB_DIR) - - include $(TOPDIR)/Make/makerules diff --git a/examples/osgcallback/osgcallback.cpp b/examples/osgcallback/osgcallback.cpp index e0113deb8..cc7dadef3 100644 --- a/examples/osgcallback/osgcallback.cpp +++ b/examples/osgcallback/osgcallback.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -15,6 +15,7 @@ #include +#include class UpdateCallback : public osg::NodeCallback { @@ -122,52 +123,19 @@ int main( int argc, char **argv ) { // 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()->setDescription(arguments.getApplicationName()+" is the example which demonstrates use of the range of different types of callbacks supported in the OpenSceneGraph."); - arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ..."); - arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information"); - // set the osgDB::Registy the read file callback to catch all requests for reading files. - osgDB::Registry::instance()->setReadFileCallback(new MyReadFileCallback()); + // set the osgDB::Registy the read file callback to catch all requests for reading files. + osgDB::Registry::instance()->setReadFileCallback(new MyReadFileCallback()); // initialize the viewer. - osgProducer::Viewer viewer(arguments); - - // set up the value with sensible default event handlers. - viewer.setUpViewer(osgProducer::Viewer::STANDARD_SETTINGS); - - // get details on keyboard and mouse bindings used by the viewer. - viewer.getUsage(*arguments.getApplicationUsage()); - - // if user request help write it out to cout. - if (arguments.read("-h") || arguments.read("--help")) - { - arguments.getApplicationUsage()->write(std::cout); - return 1; - } - - // any option left unread are converted into errors to write out later. - arguments.reportRemainingOptionsAsUnrecognized(); - - // report any errors if they have occured when parsing the program aguments. - if (arguments.errors()) - { - arguments.writeErrorMessages(std::cout); - return 1; - } - - if (arguments.argc()<=1) - { - arguments.getApplicationUsage()->write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION); - return 1; - } + osgViewer::Viewer viewer; // load the nodes from the commandline arguments. osg::Node* rootnode = osgDB::readNodeFiles(arguments); if (!rootnode) { -// write_usage(osg::notify(osg::NOTICE),argv[0]); + osg::notify(osg::NOTICE)<<"Please specify a file on the command line"<