Changeset 12279 for code/branches/MouseAPI_FS19
- Timestamp:
- Apr 4, 2019, 4:21:48 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapi.cc
r12275 r12279 12 12 void MouseAPI::activate() 13 13 { 14 active = true; 15 if(InputManager::exists()) 16 { 17 //cam = CameraManager::getInstance().getActiveCamera()->getOgreCamera(); 18 state = InputManager::getInstance().createInputState("MouseAPI",true,true,99); 19 state->setMouseExclusive(false);//does this work 20 state->setMouseHandler(this); 21 InputManager::getInstance().enterState("MouseAPI"); 14 if(!active) 15 { 16 active = true; 17 if(InputManager::exists()) 18 { 19 //cam = CameraManager::getInstance().getActiveCamera()->getOgreCamera(); 20 state = InputManager::getInstance().createInputState("MouseAPI",true,true,99); 21 state->setMouseExclusive(false);//does this work 22 state->setMouseHandler(this); 23 InputManager::getInstance().enterState("MouseAPI"); 24 } 22 25 } 23 26 … … 26 29 void MouseAPI::deactivate() 27 30 { 28 active = false; 29 if(InputManager::exists()) 31 if(active) 30 32 { 31 InputManager::getInstance().leaveState("MouseAPI"); 32 state->setMouseHandler(nullptr); 33 InputManager::getInstance().destroyState("MouseAPI"); 33 active = false; 34 if(InputManager::exists()) 35 { 36 InputManager::getInstance().leaveState("MouseAPI"); 37 state->setMouseHandler(nullptr); 38 InputManager::getInstance().destroyState("MouseAPI"); 39 } 40 clickEvents.clear(); 41 scrollEvents.clear(); 34 42 } 35 clickEvents.clear();36 scrollEvents.clear();37 43 } 38 44
Note: See TracChangeset
for help on using the changeset viewer.