Changeset 1035 for code/trunk/src/orxonox/core/InputManager.cc
- Timestamp:
- Apr 12, 2008, 11:23:32 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/core/InputManager.cc
r1034 r1035 43 43 @brief The reference to the singleton 44 44 */ 45 InputManager* InputManager::singletonRef_s = 0;45 //InputManager* InputManager::singletonRef_s = 0; 46 46 47 47 /** … … 60 60 InputManager::~InputManager() 61 61 { 62 this->destroy Devices();62 this->destroy(); 63 63 } 64 64 65 65 /** 66 66 @brief The one instance of the InputManager is stored in this function. 67 @return The pointer to the only instance of the InputManager 68 */ 69 InputManager *InputManager::getSingleton() 70 { 71 if (!singletonRef_s) 72 singletonRef_s = new InputManager(); 73 return singletonRef_s; 67 @return A reference to the only instance of the InputManager 68 */ 69 InputManager& InputManager::getSingleton() 70 { 71 static InputManager theOnlyInstance; 72 return theOnlyInstance; 74 73 } 75 74 … … 142 141 143 142 /** 144 @brief Destroys all the created input devices .145 */ 146 void InputManager::destroy Devices()147 { 148 COUT(ORX_DEBUG) << "*** InputManager: Destroying InputManager..." << std::endl;143 @brief Destroys all the created input devices and handlers. 144 */ 145 void InputManager::destroy() 146 { 147 COUT(ORX_DEBUG) << "*** InputManager: Destroying ..." << std::endl; 149 148 if (this->mouse_) 150 149 this->inputSystem_->destroyInputObject(mouse_); … … 157 156 this->keyboard_ = 0; 158 157 this->inputSystem_ = 0; 158 159 if (this->handlerBuffer_) 160 delete this->handlerBuffer_; 161 if (this->handlerGame_) 162 delete this->handlerGame_; 163 if (this->handlerGUI_) 164 delete this->handlerGUI_; 165 166 this->handlerBuffer_ = 0; 167 this->handlerGame_ = 0; 168 this->handlerGUI_ = 0; 169 159 170 COUT(ORX_DEBUG) << "*** InputManager: Destroying done." << std::endl; 160 }161 162 /**163 @brief Destroys the singleton.164 */165 void InputManager::destroySingleton()166 {167 if (singletonRef_s)168 delete singletonRef_s;169 singletonRef_s = 0;170 171 } 171 172
Note: See TracChangeset
for help on using the changeset viewer.