Changeset 1112 for code/branches/input/src/orxonox/Orxonox.cc
- Timestamp:
- Apr 19, 2008, 10:31:52 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/input/src/orxonox/Orxonox.cc
r1092 r1112 54 54 //#include "util/Sleep.h" 55 55 #include "util/ArgReader.h" 56 #include "util/FloatParser.h" 56 57 57 58 // core … … 123 124 InputBuffer* ib_; 124 125 }; 126 127 class Calculator 128 { 129 public: 130 static void calculate(std::string calculation) 131 { 132 char** useless = 0; 133 double result = 0.0; 134 bool success = parse_float((char* const)calculation.c_str(), useless, &result); 135 if (success) 136 { 137 if (result == 42.0) 138 std::cout << "Greetings from the restaurant at the end of the universe." << std::endl; 139 std::cout << "Result is: " << result << std::endl; 140 } 141 else 142 std::cout << "Cannot calculate expression: Parse error" << std::endl; 143 } 144 }; 145 ConsoleCommandShortcut(Calculator, calculate, AccessLevel::None); 125 146 126 147 /** … … 410 431 return; 411 432 } 433 Ogre::Root& ogreRoot = Ogre::Root::getSingleton(); 434 412 435 413 436 // Contains the times of recently fired events … … 429 452 { 430 453 // Pump messages in all registered RenderWindows 454 // This calls the WindowEventListener objects. 431 455 Ogre::WindowEventUtilities::messagePump(); 432 456 … … 452 476 // don't forget to call _fireFrameStarted in ogre to make sure 453 477 // everything goes smoothly 454 Ogre::Root::getSingleton()._fireFrameStarted(evt);478 ogreRoot._fireFrameStarted(evt); 455 479 456 480 // server still renders at the moment 457 481 //if (mode_ != SERVER) 458 Ogre::Root::getSingleton()._updateAllRenderTargets(); // only render in non-server mode482 ogreRoot._updateAllRenderTargets(); // only render in non-server mode 459 483 460 484 // get current time … … 466 490 467 491 // again, just to be sure ogre works fine 468 Ogre::Root::getSingleton()._fireFrameEnded(evt);492 ogreRoot._fireFrameEnded(evt); 469 493 } 470 494 }
Note: See TracChangeset
for help on using the changeset viewer.