Changeset 4138 for OpenSceneGraph/trunk/examples/osgshaders/osgshaders.cpp
- Timestamp:
- 05/02/05 11:34:27 (8 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgshaders/osgshaders.cpp
r3984 r4138 11 11 */ 12 12 13 /* file: examples/osgglsl/osgshaders.cpp14 * author: Mike Weiblen 2005-04-0513 /* file: examples/osgglsl/osgshaders.cpp 14 * author: Mike Weiblen 2005-04-05 15 15 * 16 16 * A demo of the OpenGL Shading Language shaders using core OSG. … … 36 36 { 37 37 public: 38 KeyHandler( GL2ScenePtr gl2Scene ) :39 _gl2Scene(gl2Scene)40 {}38 KeyHandler( GL2ScenePtr gl2Scene ) : 39 _gl2Scene(gl2Scene) 40 {} 41 41 42 bool handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& )43 {44 if( ea.getEventType() != osgGA::GUIEventAdapter::KEYDOWN )45 return false;42 bool handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& ) 43 { 44 if( ea.getEventType() != osgGA::GUIEventAdapter::KEYDOWN ) 45 return false; 46 46 47 switch( ea.getKey() )48 {49 case 'x':50 _gl2Scene->reloadShaderSource();51 return true;52 case 'y':53 _gl2Scene->toggleShaderEnable();54 return true;55 }56 return false;57 }47 switch( ea.getKey() ) 48 { 49 case 'x': 50 _gl2Scene->reloadShaderSource(); 51 return true; 52 case 'y': 53 _gl2Scene->toggleShaderEnable(); 54 return true; 55 } 56 return false; 57 } 58 58 59 59 private: 60 GL2ScenePtr _gl2Scene;60 GL2ScenePtr _gl2Scene; 61 61 }; 62 62 … … 71 71 args.getApplicationUsage()->setApplicationName(args.getApplicationName()); 72 72 args.getApplicationUsage()->setDescription(args.getApplicationName() + 73 " demonstrates the OpenGL Shading Language using core OSG");73 " demonstrates the OpenGL Shading Language using core OSG"); 74 74 args.getApplicationUsage()->setCommandLineUsage(args.getApplicationName()); 75 75 args.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
