diff --git a/examples/Makefile b/examples/Makefile new file mode 100644 index 000000000..9905dfdc3 --- /dev/null +++ b/examples/Makefile @@ -0,0 +1,7 @@ +TOPDIR = .. +include $(TOPDIR)/Make/makedirdefs +include $(TOPDIR)/Make/makedefs + +DIRS = $(EXAMPLE_DIRS) + +include $(TOPDIR)/Make/makedirrules diff --git a/examples/osgcameragroup/osgcameragroup.cpp b/examples/osgcameragroup/osgcameragroup.cpp index b7d3b1cbc..fc752ffb6 100644 --- a/examples/osgcameragroup/osgcameragroup.cpp +++ b/examples/osgcameragroup/osgcameragroup.cpp @@ -154,10 +154,6 @@ int main( int argc, char **argv ) init_event->adaptFrame(0.0); keyswitchManipulator->getCurrentCameraManipulator()->home(*init_event,actionAdapter); - double previous_time_since_start = 0.0f; - int number_frames_since_last_print = 0; - int number_of_frame_samples = 10; - bool printOutFrameStats=true; while( !done ) { // syncronize to screen refresh. @@ -168,15 +164,6 @@ int main( int argc, char **argv ) frameStamp->setFrameNumber(frameNumber); frameStamp->setReferenceTime(time_since_start); - if (printOutFrameStats) - { - if (number_frames_since_last_print==number_of_frame_samples) - { - cout << "frame rate = "<< (double)number_of_frame_samples/(time_since_start-previous_time_since_start)< +#include #include +#include + using namespace Producer; using namespace osgProducer; @@ -26,6 +28,12 @@ std::string findCameraConfigFile(const std::string& configFile) std::string extractCameraConfigFile(osg::ArgumentParser& arguments) { + // report the usage options. + if (arguments.getApplicationUsage()) + { + arguments.getApplicationUsage()->addCommandLineOption("-c ","Specify camera config file"); + } + std::string filename; if (arguments.read("-c",filename)) return filename; return ""; diff --git a/src/osgProducer/Viewer.cpp b/src/osgProducer/Viewer.cpp index b6270c167..f1f74e72a 100644 --- a/src/osgProducer/Viewer.cpp +++ b/src/osgProducer/Viewer.cpp @@ -102,6 +102,9 @@ void Viewer::setUpViewer(unsigned int options) // enable depth testing by default. globalStateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::ON); + // enable lighting by default + globalStateSet->setMode(GL_LIGHTING, osg::StateAttribute::ON); + // set up an alphafunc by default to speed up blending operations. osg::AlphaFunc* alphafunc = new osg::AlphaFunc; alphafunc->setFunction(osg::AlphaFunc::GREATER,0.0f); diff --git a/src/osgText/Font.cpp b/src/osgText/Font.cpp index 3b0076522..25f8d5a44 100644 --- a/src/osgText/Font.cpp +++ b/src/osgText/Font.cpp @@ -107,7 +107,7 @@ std::string Font::getFileName() const void Font::setSize(unsigned int width, unsigned int height) { - if (_implementation.valid()) return _implementation->setSize(width, height); + if (_implementation.valid()) _implementation->setSize(width, height); } Font::Glyph* Font::getGlyph(unsigned int charcode) diff --git a/src/osgText/String.cpp b/src/osgText/String.cpp index 90e892ec3..6b4103876 100644 --- a/src/osgText/String.cpp +++ b/src/osgText/String.cpp @@ -236,7 +236,7 @@ unsigned int getNextCharacter(look_ahead_iterator& charString,String::Encoding e // String::String(const String& str): - Referenced(), + osg::Referenced(), std::vector(str) { }