Changeset 2816 for code/branches/gui/src/orxonox/gamestates
- Timestamp:
- Mar 21, 2009, 8:47:11 PM (16 years ago)
- Location:
- code/branches/gui/src/orxonox/gamestates
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/orxonox/gamestates/GSGraphics.cc
r2805 r2816 39 39 #include "core/input/InputManager.h" 40 40 #include "core/input/KeyBinder.h" 41 #include "core/input/ ExtendedInputState.h"41 #include "core/input/SimpleInputState.h" 42 42 #include "core/Loader.h" 43 43 #include "core/XMLFile.h" … … 57 57 , graphicsManager_(0) 58 58 , masterKeyBinder_(0) 59 , masterInputState_(0) 59 60 , debugOverlay_(0) 60 61 { … … 91 92 renderWindow->getCustomAttribute("WINDOW", &windowHnd); 92 93 inputManager_->initialise(windowHnd, renderWindow->getWidth(), renderWindow->getHeight(), true); 93 // Configure master input state with a KeyBinder 94 95 masterInputState_ = InputManager::getInstance().createInputState<SimpleInputState>("master", true); 94 96 masterKeyBinder_ = new KeyBinder(); 95 97 masterKeyBinder_->loadBindings("masterKeybindings.ini"); 96 inputManager_->getMasterInputState()->addKeyHandler(masterKeyBinder_);98 masterInputState_->setKeyHandler(masterKeyBinder_); 97 99 98 100 // Load the InGameConsole … … 103 105 guiManager_ = new GUIManager(); 104 106 guiManager_->initialise(renderWindow); 107 108 InputManager::getInstance().requestEnterState("master"); 105 109 } 106 110 107 111 void GSGraphics::leave() 108 112 { 113 if (Core::showsGraphics()) 114 InputManager::getInstance().requestLeaveState("master"); 115 109 116 delete this->guiManager_; 110 117 … … 119 126 120 127 delete graphicsManager_; 128 129 if (Core::showsGraphics()) 130 { 131 masterInputState_->setHandler(0); 132 InputManager::getInstance().requestDestroyState("master"); 133 if (this->masterKeyBinder_) 134 { 135 delete this->masterKeyBinder_; 136 this->masterKeyBinder_ = 0; 137 } 138 } 121 139 } 122 140 -
code/branches/gui/src/orxonox/gamestates/GSGraphics.h
r2801 r2816 65 65 66 66 KeyBinder* masterKeyBinder_; 67 SimpleInputState* masterInputState_; 67 68 XMLFile* debugOverlay_; 68 69 };
Note: See TracChangeset
for help on using the changeset viewer.