- Timestamp:
- 01/08/07 11:00:16 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgparametric/osgparametric.cpp
r5863 r5927 14 14 #include <osgUtil/TriStripVisitor> 15 15 16 #include <osgProducer/Viewer> 16 #include <osgViewer/Viewer> 17 18 #include <iostream> 17 19 18 20 // for the grid data.. … … 512 514 513 515 // construct the viewer. 514 osgProducer::Viewer viewer(arguments); 515 516 // set up the value with sensible default event handlers. 517 viewer.setUpViewer(osgProducer::Viewer::STANDARD_SETTINGS); 518 516 osgViewer::Viewer viewer; 517 519 518 std::string shader("simple"); 520 519 while(arguments.read("-s",shader)) {} … … 541 540 while(arguments.read("--join")) { joinStrips = true; } 542 541 543 // get details on keyboard and mouse bindings used by the viewer.544 viewer.getUsage(*arguments.getApplicationUsage());545 546 542 // if user request help write it out to cout. 547 543 if (arguments.read("-h") || arguments.read("--help")) 548 544 { 549 545 arguments.getApplicationUsage()->write(std::cout); 550 return 1;551 }552 553 // any option left unread are converted into errors to write out later.554 arguments.reportRemainingOptionsAsUnrecognized();555 556 // report any errors if they have occured when parsing the program aguments.557 if (arguments.errors())558 {559 arguments.writeErrorMessages(std::cout);560 546 return 1; 561 547 } … … 567 553 return 1; 568 554 } 569 570 // add a viewport to the viewer and attach the scene graph. 555 571 556 viewer.setSceneData(model); 572 573 // create the windows and run the threads. 574 viewer.realize(); 575 576 while( !viewer.done() ) 577 { 578 // wait for all cull and draw threads to complete. 579 viewer.sync(); 580 581 // update the scene by traversing it with the the update visitor which will 582 // call all node update callbacks and animations. 583 viewer.update(); 584 585 // fire off the cull and draw traversals of the scene. 586 viewer.frame(); 587 588 } 589 590 // wait for all cull and draw threads to complete. 591 viewer.sync(); 592 593 // run a clean up frame to delete all OpenGL objects. 594 viewer.cleanup_frame(); 595 596 // wait for all the clean up frame to complete. 597 viewer.sync(); 598 599 return 0; 557 558 return viewer.run(); 600 559 }
