Changeset 2875 for code/branches/gui/src/orxonox/gamestates/GSGraphics.cc
- Timestamp:
- Mar 31, 2009, 2:14:09 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/orxonox/gamestates/GSGraphics.cc
r2869 r2875 23 23 * Reto Grieder 24 24 * Co-authors: 25 * ... 26 * 25 * Benjamin Knecht 26 * 27 */ 28 29 /** 30 @file 31 @brief Implementation of Graphics GameState class. 27 32 */ 28 33 … … 71 76 } 72 77 78 /** 79 @brief 80 this function does nothing 81 82 Indeed. Here goes nothing. 83 */ 73 84 void GSGraphics::setConfigValues() 74 85 { 75 86 } 76 87 88 /** 89 @brief 90 This function is called when we enter this game state. 91 92 Since graphics is very important for our game this function does quite a lot: 93 \li starts graphics manager 94 \li loads debug overlay 95 \li manages render window 96 \li creates input manager 97 \li loads master key bindings 98 \li loads ingame console 99 \li loads GUI interface (GUIManager) 100 \li creates console command to toggle GUI 101 */ 77 102 void GSGraphics::activate() 78 103 { … … 90 115 Loader::open(debugOverlay_); 91 116 92 // Calls the InputManager which sets up the input devices.93 117 // The render window width and height are used to set up the mouse movement. 94 inputManager_ = new InputManager();95 118 size_t windowHnd = 0; 96 119 Ogre::RenderWindow* renderWindow = GraphicsManager::getInstance().getRenderWindow(); 97 120 renderWindow->getCustomAttribute("WINDOW", &windowHnd); 121 122 // Calls the InputManager which sets up the input devices. 123 inputManager_ = new InputManager(); 98 124 inputManager_->initialise(windowHnd, renderWindow->getWidth(), renderWindow->getHeight(), true); 99 125 126 // load master key bindings 100 127 masterInputState_ = InputManager::getInstance().createInputState<SimpleInputState>("master", true); 101 128 masterKeyBinder_ = new KeyBinder(); … … 111 138 guiManager_->initialise(renderWindow); 112 139 140 // add console command to toggle GUI 113 141 FunctorMember<GSGraphics>* functor = createFunctor(&GSGraphics::toggleGUI); 114 142 functor->setObject(this); … … 116 144 CommandExecutor::addConsoleCommandShortcut(this->ccToggleGUI_); 117 145 118 146 // enable master input 119 147 InputManager::getInstance().requestEnterState("master"); 120 148 } 121 149 150 /** 151 @brief 152 This function is called when the game state is left 153 154 Created references, input states and console commands are deleted. 155 */ 122 156 void GSGraphics::deactivate() 123 157 { … … 147 181 } 148 182 183 /** 184 @brief 185 Toggles the visibility of the current GUI 186 187 This function just executes a Lua function in the main script of the GUI by accessing the GUIManager. 188 For more details on this function check out the Lua code. 189 */ 149 190 void GSGraphics::toggleGUI() 150 191 {
Note: See TracChangeset
for help on using the changeset viewer.