diff --git a/Makefile b/Makefile index c3a140269..a789ce643 100644 --- a/Makefile +++ b/Makefile @@ -168,3 +168,8 @@ stats : cat src/Demos/*/*.cpp | wc -l cat src/osgPlugins/*/*.cpp src/osgPlugins/*/*.h | wc -l cat include/*/* src/*/*.cpp src/Demos/*/*.cpp src/osgPlugins/*/*.cpp src/osgPlugins/*/*.h | wc -l + + +test : + @echo running tests: + for f in $(DIRS) ; do cd $$f; $(MAKE) test; cd ..; done diff --git a/src/Demos/Makefile b/src/Demos/Makefile index 85f5a3071..887bf7fa0 100644 --- a/src/Demos/Makefile +++ b/src/Demos/Makefile @@ -36,3 +36,6 @@ instlinks : instclean : for f in $(DIRS) ; do cd $$f; $(MAKE) instclean; cd ..; done + +test : + for f in $(DIRS) ; do cd $$f; $(MAKE) test; cd ..; done diff --git a/src/Demos/hangglide/Makefile b/src/Demos/hangglide/Makefile index 1f51b4510..46e2118ef 100644 --- a/src/Demos/hangglide/Makefile +++ b/src/Demos/hangglide/Makefile @@ -31,3 +31,6 @@ C++FLAGS += -I. -I$(OSGHOME)/include LDFLAGS += -L$(OSGHOME)/lib include $(OSGHOME)/Make/makerules + +test : + hangglide diff --git a/src/Demos/hangglide/hangglide.cpp b/src/Demos/hangglide/hangglide.cpp index c35d18b3f..6e721515b 100644 --- a/src/Demos/hangglide/hangglide.cpp +++ b/src/Demos/hangglide/hangglide.cpp @@ -33,6 +33,7 @@ int main( int argc, char **argv ) // initialize the viewer. osgGLUT::Viewer viewer; + viewer.setWindowTitle(argv[0]); // configure the viewer from the commandline arguments, and eat any // parameters that have been matched. diff --git a/src/Demos/osgbillboard/Makefile b/src/Demos/osgbillboard/Makefile index 890cf4da2..5f400881a 100644 --- a/src/Demos/osgbillboard/Makefile +++ b/src/Demos/osgbillboard/Makefile @@ -22,3 +22,6 @@ C++FLAGS += -I$(OSGHOME)/include LDFLAGS += -L$(OSGHOME)/lib include $(OSGHOME)/Make/makerules + +test : + osgbillboard Images/tree0.rgba Images/reflect.rgb diff --git a/src/Demos/osgbillboard/osgbillboard.cpp b/src/Demos/osgbillboard/osgbillboard.cpp index 36265cc2e..c6fec11e9 100644 --- a/src/Demos/osgbillboard/osgbillboard.cpp +++ b/src/Demos/osgbillboard/osgbillboard.cpp @@ -384,6 +384,7 @@ int main( int argc, char **argv ) // initialize the viewer. osgGLUT::Viewer viewer; + viewer.setWindowTitle(argv[0]); // configure the viewer from the commandline arguments, and eat any // parameters that have been matched. diff --git a/src/Demos/osgcluster/Makefile b/src/Demos/osgcluster/Makefile index 72070556c..944337cd7 100644 --- a/src/Demos/osgcluster/Makefile +++ b/src/Demos/osgcluster/Makefile @@ -23,3 +23,5 @@ LDFLAGS += -L$(OSGHOME)/lib include $(OSGHOME)/Make/makerules +test : + @echo no current test for osgconv: diff --git a/src/Demos/osgcluster/osgcluster.cpp b/src/Demos/osgcluster/osgcluster.cpp index 555c7efa2..5c0a263f6 100644 --- a/src/Demos/osgcluster/osgcluster.cpp +++ b/src/Demos/osgcluster/osgcluster.cpp @@ -337,6 +337,7 @@ int main( int argc, char **argv ) // initialize the viewer. osgGLUT::Viewer viewer; + viewer.setWindowTitle(argv[0]); viewer.addViewport( mySceneView.get() ); // register trackball, flight and drive. diff --git a/src/Demos/osgconv/Makefile b/src/Demos/osgconv/Makefile index c925aa568..30e31be9e 100644 --- a/src/Demos/osgconv/Makefile +++ b/src/Demos/osgconv/Makefile @@ -23,3 +23,6 @@ C++FLAGS += -I$(OSGHOME)/include LDFLAGS += -L$(OSGHOME)/lib include $(OSGHOME)/Make/makerules + +test : + @echo no current test for osgconv: diff --git a/src/Demos/osgcopy/Makefile b/src/Demos/osgcopy/Makefile index f30c733a0..e8304729a 100644 --- a/src/Demos/osgcopy/Makefile +++ b/src/Demos/osgcopy/Makefile @@ -20,3 +20,5 @@ LDFLAGS += -L$(OSGHOME)/lib include $(OSGHOME)/Make/makerules +test : + @echo no current test for osgconv: diff --git a/src/Demos/osgcopy/osgcopy.cpp b/src/Demos/osgcopy/osgcopy.cpp index 00d4dde1e..44fd7578c 100644 --- a/src/Demos/osgcopy/osgcopy.cpp +++ b/src/Demos/osgcopy/osgcopy.cpp @@ -183,6 +183,7 @@ int main( int argc, char **argv ) // initialize the viewer. osgGLUT::Viewer viewer; + viewer.setWindowTitle(argv[0]); // configure the viewer from the commandline arguments, and eat any // parameters that have been matched. diff --git a/src/Demos/osgcube/Makefile b/src/Demos/osgcube/Makefile index d3a74d783..a4a5426dc 100644 --- a/src/Demos/osgcube/Makefile +++ b/src/Demos/osgcube/Makefile @@ -17,3 +17,6 @@ C++FLAGS += -I$(OSGHOME)/include LDFLAGS += -L$(OSGHOME)/lib include $(OSGHOME)/Make/makerules + +test : + osgcube diff --git a/src/Demos/osgcube/osgcube.cpp b/src/Demos/osgcube/osgcube.cpp index 51303c92d..90bc6366b 100644 --- a/src/Demos/osgcube/osgcube.cpp +++ b/src/Demos/osgcube/osgcube.cpp @@ -170,6 +170,7 @@ int main( int argc, char **argv ) // create the viewer and the model to it. osgGLUT::Viewer viewer; + viewer.setWindowTitle(argv[0]); // configure the viewer from the commandline arguments, and eat any // parameters that have been matched. diff --git a/src/Demos/osgimpostor/Makefile b/src/Demos/osgimpostor/Makefile index 723fce1b5..4a42c0f85 100644 --- a/src/Demos/osgimpostor/Makefile +++ b/src/Demos/osgimpostor/Makefile @@ -22,3 +22,5 @@ LDFLAGS += -L$(OSGHOME)/lib include $(OSGHOME)/Make/makerules +test : + osgimpostor Town.osg diff --git a/src/Demos/osgimpostor/osgimpostor.cpp b/src/Demos/osgimpostor/osgimpostor.cpp index 083251e7b..90654b907 100644 --- a/src/Demos/osgimpostor/osgimpostor.cpp +++ b/src/Demos/osgimpostor/osgimpostor.cpp @@ -66,6 +66,7 @@ int main( int argc, char **argv ) // initialize the viewer. osgGLUT::Viewer viewer; + viewer.setWindowTitle(argv[0]); // configure the viewer from the commandline arguments, and eat any // parameters that have been matched. diff --git a/src/Demos/osgreflect/Makefile b/src/Demos/osgreflect/Makefile index 8785e214b..61724b009 100644 --- a/src/Demos/osgreflect/Makefile +++ b/src/Demos/osgreflect/Makefile @@ -22,3 +22,6 @@ C++FLAGS += -I$(OSGHOME)/include LDFLAGS += -L$(OSGHOME)/lib include $(OSGHOME)/Make/makerules + +test : + osgreflect cow.osg diff --git a/src/Demos/osgreflect/osgreflect.cpp b/src/Demos/osgreflect/osgreflect.cpp index 936c7007e..d9624c3e5 100644 --- a/src/Demos/osgreflect/osgreflect.cpp +++ b/src/Demos/osgreflect/osgreflect.cpp @@ -149,6 +149,7 @@ int main( int argc, char **argv ) // initialize the viewer. osgGLUT::Viewer viewer; + viewer.setWindowTitle(argv[0]); // configure the viewer from the commandline arguments, and eat any // parameters that have been matched. diff --git a/src/Demos/osgscribe/Makefile b/src/Demos/osgscribe/Makefile index a6f543418..955b15a7d 100644 --- a/src/Demos/osgscribe/Makefile +++ b/src/Demos/osgscribe/Makefile @@ -20,3 +20,5 @@ LDFLAGS += -L$(OSGHOME)/lib include $(OSGHOME)/Make/makerules +test : + osgscribe cow.osg diff --git a/src/Demos/osgscribe/osgscribe.cpp b/src/Demos/osgscribe/osgscribe.cpp index af213df33..855ef5cc2 100644 --- a/src/Demos/osgscribe/osgscribe.cpp +++ b/src/Demos/osgscribe/osgscribe.cpp @@ -70,6 +70,7 @@ int main( int argc, char **argv ) // initialize the viewer. osgGLUT::Viewer viewer; + viewer.setWindowTitle(argv[0]); // configure the viewer from the commandline arguments, and eat any // parameters that have been matched. diff --git a/src/Demos/osgtext/Makefile b/src/Demos/osgtext/Makefile index 0e32e0fe6..a9e0fc8ac 100644 --- a/src/Demos/osgtext/Makefile +++ b/src/Demos/osgtext/Makefile @@ -18,5 +18,8 @@ MACOSXLIBS = -losgGLUT -losgText -losgUtil -losgDB -losg -lfreetype -ldl -lobjc C++FLAGS += -I$(OSGHOME)/include -I. LDFLAGS += -L$(OSGHOME)/lib -L/usr/freeware/lib32 + include $(OSGHOME)/Make/makerules +test : + osgtext diff --git a/src/Demos/osgtext/main.cpp b/src/Demos/osgtext/main.cpp index d1501ae0f..4b042b758 100644 --- a/src/Demos/osgtext/main.cpp +++ b/src/Demos/osgtext/main.cpp @@ -585,6 +585,7 @@ int main( int argc, char **argv ) // initialize the viewer. TextViewer viewer; + viewer.setWindowTitle(argv[0]); /* viewer.addViewport( rootNode ); viewer.getViewportSceneView(0)->setBackgroundColor(osg::Vec4(.2,.2,.2,1)); diff --git a/src/Demos/osgtexture/Makefile b/src/Demos/osgtexture/Makefile index 9aeca9907..935ff2769 100644 --- a/src/Demos/osgtexture/Makefile +++ b/src/Demos/osgtexture/Makefile @@ -22,3 +22,6 @@ C++FLAGS += -I$(OSGHOME)/include LDFLAGS += -L$(OSGHOME)/lib include $(OSGHOME)/Make/makerules + +test : + osgtexture Images/lz.rgb Images/reflect.rgb diff --git a/src/Demos/osgtexture/osgtexture.cpp b/src/Demos/osgtexture/osgtexture.cpp index 574c3e736..aaa480bb7 100644 --- a/src/Demos/osgtexture/osgtexture.cpp +++ b/src/Demos/osgtexture/osgtexture.cpp @@ -380,6 +380,7 @@ int main( int argc, char **argv ) // initialize the viewer. osgGLUT::Viewer viewer; + viewer.setWindowTitle(argv[0]); // configure the viewer from the commandline arguments, and eat any // parameters that have been matched. diff --git a/src/Demos/osgviews/Makefile b/src/Demos/osgviews/Makefile index aa7cdb667..775930707 100644 --- a/src/Demos/osgviews/Makefile +++ b/src/Demos/osgviews/Makefile @@ -22,3 +22,6 @@ LDFLAGS += -L$(OSGHOME)/lib include $(OSGHOME)/Make/makerules +test : + osgviews glider.osg + diff --git a/src/Demos/osgviews/osgviews.cpp b/src/Demos/osgviews/osgviews.cpp index 98406eb09..053b2ebd9 100644 --- a/src/Demos/osgviews/osgviews.cpp +++ b/src/Demos/osgviews/osgviews.cpp @@ -64,6 +64,7 @@ int main( int argc, char **argv ) // initialize the viewer. osgGLUT::Viewer viewer; + viewer.setWindowTitle(argv[0]); // configure the viewer from the commandline arguments, and eat any // parameters that have been matched. diff --git a/src/Demos/sgv/Makefile b/src/Demos/sgv/Makefile index 2bbfc0c8d..6ad9c641e 100644 --- a/src/Demos/sgv/Makefile +++ b/src/Demos/sgv/Makefile @@ -18,5 +18,10 @@ MACOSXLIBS = -losgGLUT -losgUtil -losgDB -losg -lm -ldl -lstdc++ -lobjc C++FLAGS += -I$(OSGHOME)/include LDFLAGS += -L$(OSGHOME)/lib + include $(OSGHOME)/Make/makerules +test : + sgv cow.osg + sgv Town.osg + diff --git a/src/Demos/sgv/sgv.cpp b/src/Demos/sgv/sgv.cpp index b37d09501..a59ada7e7 100644 --- a/src/Demos/sgv/sgv.cpp +++ b/src/Demos/sgv/sgv.cpp @@ -67,7 +67,8 @@ int main( int argc, char **argv ) // initialize the viewer. osgGLUT::Viewer viewer; - + viewer.setWindowTitle(argv[0]); + // configure the viewer from the commandline arguments, and eat any // parameters that have been matched. viewer.readCommandLine(commandLine); diff --git a/src/Makefile b/src/Makefile index e89e1ec0a..176e87ce6 100644 --- a/src/Makefile +++ b/src/Makefile @@ -43,3 +43,6 @@ instlinks : instclean : for f in $(DIRS) ; do cd $$f; $(MAKE) instclean; cd ..; done + +test : + (cd Demos; make test; ) diff --git a/src/osgUtil/DepthSortedBin.cpp b/src/osgUtil/DepthSortedBin.cpp index 8b649d1ef..b6d89c15f 100644 --- a/src/osgUtil/DepthSortedBin.cpp +++ b/src/osgUtil/DepthSortedBin.cpp @@ -75,6 +75,8 @@ void DepthSortedBin::sort_local() void DepthSortedBin::draw_local(osg::State& state,RenderLeaf*& previous) { + sort_local(); + if (_drawOrder==BACK_TO_FRONT) { // render the bin from back to front. diff --git a/src/osgUtil/RenderBin.cpp b/src/osgUtil/RenderBin.cpp index d688b2f7b..e091d956b 100644 --- a/src/osgUtil/RenderBin.cpp +++ b/src/osgUtil/RenderBin.cpp @@ -149,6 +149,8 @@ void RenderBin::draw(osg::State& state,RenderLeaf*& previous) void RenderBin::draw_local(osg::State& state,RenderLeaf*& previous) { + sort_local(); + // draw local bin. for(RenderGraphList::iterator oitr=_renderGraphList.begin(); oitr!=_renderGraphList.end(); diff --git a/src/osgUtil/SceneView.cpp b/src/osgUtil/SceneView.cpp index 50df28d39..04b9256d6 100644 --- a/src/osgUtil/SceneView.cpp +++ b/src/osgUtil/SceneView.cpp @@ -223,10 +223,6 @@ void SceneView::cull() _cullVisitor->popCullViewState(); - // do any state sorting required. - _renderStage->sort(); - - const osg::EarthSky* earthSky = _cullVisitor->getEarthSky(); if (earthSky) {