Changeset 3370 for code/trunk/src/core/input
- Timestamp:
- Jul 30, 2009, 2:10:44 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/resource (added) merged: 3328,3336-3340,3342-3350,3352-3366
- Property svn:mergeinfo changed
-
code/trunk/src/core/input/InputManager.cc
r3331 r3370 64 64 InputHandler InputHandler::EMPTY; 65 65 66 InputManager* InputManager::singleton Ref_s = 0;66 InputManager* InputManager::singletonPtr_s = 0; 67 67 68 68 //! Defines the |= operator for easier use. … … 93 93 RegisterRootObject(InputManager); 94 94 95 assert(singletonRef_s == 0);96 singletonRef_s = this;97 98 95 CCOUT(4) << "Constructing..." << std::endl; 99 96 … … 138 135 } 139 136 137 CCOUT(4) << "Construction complete." << std::endl; 140 138 internalState_ = Nothing; 141 CCOUT(4) << "Construction complete." << std::endl;142 139 } 143 140 … … 297 294 298 295 CCOUT(4) << "Destruction complete." << std::endl; 299 singletonRef_s = 0;300 296 } 301 297 -
code/trunk/src/core/input/InputManager.h
r3327 r3370 37 37 #include <vector> 38 38 39 #include "util/Singleton.h" 39 40 #include "core/WindowEventListener.h" 40 41 #include "InputState.h" … … 62 63 If the OIS::InputManager or the Keyboard fail, an exception is thrown. 63 64 */ 64 class _CoreExport InputManager : public WindowEventListener65 class _CoreExport InputManager : public Singleton<InputManager>, public WindowEventListener 65 66 { 67 friend class Singleton<InputManager>; 66 68 public: 67 69 //! Represents internal states of the InputManager. … … 168 170 { return this->oisInputManager_; } 169 171 170 //! Returns a reference to the singleton instance171 static InputManager& getInstance() { assert(singletonRef_s); return *singletonRef_s; }172 173 172 private: // functions 174 173 // don't mess with a Singleton … … 211 210 std::set<InputState*> stateDestroyRequests_; //!< Requests to destroy a state 212 211 213 static InputManager* singleton Ref_s; //!< Pointer reference to the singleton212 static InputManager* singletonPtr_s; //!< Pointer reference to the singleton 214 213 }; 215 214 }
Note: See TracChangeset
for help on using the changeset viewer.