Added write to file and use of clearnode

This commit is contained in:
Robert Osfield 2004-11-18 15:10:24 +00:00
parent 138c1ddd05
commit 9dc4fb1a34

View File

@ -17,6 +17,7 @@
#include <osg/LineWidth>
#include <osg/TexEnv>
#include <osg/TexEnvCombine>
#include <osg/ClearNode>
#include <osgUtil/Optimizer>
@ -608,6 +609,10 @@ int main( int argc, char **argv )
osg::Group* root = new osg::Group;
osg::ClearNode* clearNode = new osg::ClearNode;
clearNode->setClearColor(osg::Vec4(0.0f,0.0f,0.0f,1.0f));
root->addChild(clearNode);
osg::Group* sunLight = solarSystem.createSunLight();
root->addChild(sunLight);
@ -767,6 +772,7 @@ int main( int argc, char **argv )
{
osgDB::writeNodeFile(*root, writeFileName);
std::cout<<"Written solar system to \""<<writeFileName<<"\""<<std::endl;
return 0;
}
@ -834,8 +840,6 @@ int main( int argc, char **argv )
// create the windows and run the threads.
viewer.realize();
viewer.setClearColor(osg::Vec4(0.0f,0.0f,0.0f,1.0f));
while( !viewer.done() )
{
// wait for all cull and draw threads to complete.