Ported all glut based demos across to using the new osg::ArgumentParser.

This commit is contained in:
Robert Osfield
2003-03-14 10:49:06 +00:00
parent 34fc7dd289
commit 2ca505b3d8
43 changed files with 873 additions and 1373 deletions

View File

@@ -42,11 +42,11 @@ class SG_EXPORT DisplaySettings : public osg::Referenced
readEnvironmentalVariables();
}
DisplaySettings(std::vector<std::string>& commandLine)
DisplaySettings(ArgumentParser& arguments)
{
setDefaults();
readEnvironmentalVariables();
readCommandLine(commandLine);
readCommandLine(arguments);
}
DisplaySettings(const DisplaySettings& vs);
@@ -61,12 +61,8 @@ class SG_EXPORT DisplaySettings : public osg::Referenced
void readEnvironmentalVariables();
/** read the command line string list, removing any matched control sequences.*/
void readCommandLine(std::vector<std::string>& commandLine);
/** read the commandline arguments.*/
void readCommandLine(ArgumentParser& parser);
void readCommandLine(ArgumentParser& arguments);
void setStereo(bool on) { _stereo = on; }

View File

@@ -51,9 +51,6 @@ class OSGDB_EXPORT Registry : public osg::Referenced
static Registry* instance();
/** read the command line string list, removing any matched control sequences.*/
void readCommandLine(std::vector<std::string>& commandLine);
/** read the command line arguments.*/
void readCommandLine(osg::ArgumentParser& commandLine);
@@ -201,12 +198,6 @@ class OSGDB_EXPORT Registry : public osg::Referenced
};
/** read the command line string list into the osgDB::Registry(), removing any matched control sequences.*/
inline void readCommandLine(std::vector<std::string>& commandLine)
{
Registry::instance()->readCommandLine(commandLine);
}
/** read the command line arguments.*/
inline void readCommandLine(osg::ArgumentParser& parser)
{

View File

@@ -19,6 +19,7 @@
#include <osg/Geode>
#include <osg/Timer>
#include <osg/DisplaySettings>
#include <osg/ArgumentParser>
#include <osgGA/GUIEventAdapter>
#include <osgGA/CameraManipulator>
@@ -46,8 +47,13 @@ class OSGGLUT_EXPORT Viewer : public Window, public osgGA::GUIActionAdapter
public:
Viewer();
Viewer(osg::ArgumentParser& arguments);
virtual ~Viewer();
/** read the command line string list, removing any matched control sequences.*/
void readCommandLine(osg::ArgumentParser& arguments);
/** init is deprecated, you should use addViewport instead. init is
* only available for backwards compatibility.*/
virtual void init(osg::Node* rootnode);
@@ -108,8 +114,6 @@ class OSGGLUT_EXPORT Viewer : public Window, public osgGA::GUIActionAdapter
/// Toggle fullscreen
virtual void toggleFullScreen();
/** read the command line string list, removing any matched control sequences.*/
void readCommandLine(std::vector<std::string>& commandLine);
void setDisplaySettings(osg::DisplaySettings* ds) { _displaySettings = ds; }
osg::DisplaySettings* getDisplaySettings() { return _displaySettings.get(); }
@@ -129,6 +133,8 @@ class OSGGLUT_EXPORT Viewer : public Window, public osgGA::GUIActionAdapter
int mapWindowXYToViewport(int x, int y);
protected:
void initialize();
virtual void clear();