| 131 | | osg::ref_ptr<osgDB::DynamicLibrary> osgProducerLib = |
| 132 | | osgDB::DynamicLibrary::loadLibrary(osgDB::Registry::instance()->createLibraryNameForNodeKit("osgProducer")); |
| 133 | | |
| 134 | | |
| 135 | | // load the scene. |
| 136 | | osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFile(argv[1]); |
| 137 | | if (!loadedModel) |
| 138 | | { |
| 139 | | std::cout << argv[0] <<": No data loaded." << std::endl; |
| 140 | | return 1; |
| 141 | | } |
| 142 | | |
| 143 | | |
| 144 | | // set up the frame stamp for current frame to record the current time and frame number so that animtion code can advance correctly |
| 145 | | osg::ref_ptr<osg::FrameStamp> frameStamp = new osg::FrameStamp; |
| 146 | | |
| 147 | | unsigned int frameNum = 0; |
| 148 | | |
| 149 | | osgUtil::UpdateVisitor updateVisitor; |
| 150 | | updateVisitor.setFrameStamp(frameStamp.get()); |
| 151 | | |
| | 130 | osg::ref_ptr<osgDB::DynamicLibrary> windowingLib = |
| | 131 | osgDB::DynamicLibrary::loadLibrary(osgDB::Registry::instance()->createLibraryNameForNodeKit(windowingLibrary)); |
| | 132 | |
| | 133 | |
| | 134 | if (!windowingLib) |
| | 135 | { |
| | 136 | std::cout<<"Error: failed to loading windowing library: "<<windowingLibrary<<std::endl; |
| | 137 | } |
| | 146 | |
| | 147 | while (arguments.read("--xpos",xpos)) {} |
| | 148 | while (arguments.read("--ypos",ypos)) {} |
| | 149 | while (arguments.read("--height",height)) {} |
| | 150 | while (arguments.read("--width",width)) {} |
| | 151 | |
| | 152 | unsigned int maxNumFrames = 1000; |
| | 153 | while (arguments.read("--max-num-frames",maxNumFrames)) {} |
| | 154 | |
| | 155 | // load the scene. |
| | 156 | osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments); |
| | 157 | if (!loadedModel) |
| | 158 | { |
| | 159 | std::cout << argv[0] <<": No data loaded." << std::endl; |
| | 160 | return 1; |
| | 161 | } |
| | 162 | |
| | 163 | |
| | 164 | // set up the frame stamp for current frame to record the current time and frame number so that animtion code can advance correctly |
| | 165 | osg::ref_ptr<osg::FrameStamp> frameStamp = new osg::FrameStamp; |
| | 166 | |
| | 167 | unsigned int frameNum = 0; |
| | 168 | |
| | 169 | osgUtil::UpdateVisitor updateVisitor; |
| | 170 | updateVisitor.setFrameStamp(frameStamp.get()); |