Changeset 3327 for code/trunk/src/core/input/Mouse.h
- Timestamp:
- Jul 19, 2009, 5:31:02 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/core4 merged: 3269,3271-3275,3278,3285,3290-3294,3310
- Property svn:mergeinfo changed
-
code/trunk/src/core/input/Mouse.h
r3276 r3327 31 31 32 32 #include "InputPrereqs.h" 33 33 34 #include "InputDevice.h" 35 #include "core/WindowEventListener.h" 34 36 35 37 namespace orxonox 36 38 { 39 //! Template parameter collection for the base class 40 struct MouseTraits 41 { 42 typedef Mouse DeviceClass; 43 typedef OIS::Mouse OISDeviceClass; 44 typedef MouseButtonCode::ByEnum ButtonType; 45 typedef MouseButtonCode::ByEnum ButtonTypeParam; 46 static const OIS::Type OISDeviceValue = OIS::OISMouse; 47 }; 48 37 49 /** 38 50 @brief … … 43 55 : public InputDeviceTemplated<MouseTraits> 44 56 , public OIS::MouseListener 57 , public WindowEventListener 45 58 { 46 59 friend class InputDeviceTemplated<MouseTraits>; … … 49 62 50 63 public: 51 Mouse(unsigned int id, unsigned int windowWidth, unsigned int windowHeight); 64 //! Only sets the clipping size. Initialising is done in the base class. 65 Mouse(unsigned int id, OIS::InputManager* oisInputManager); 52 66 ~Mouse() { } 53 67 54 /**55 @brief56 Adjusts the mouse window metrics.57 58 This method has to be called every time the size of the window changes.59 */60 void setMouseClipping(unsigned int width, unsigned int height);61 unsigned int getClippingWidth() const;62 unsigned int getClippingHeight() const;63 64 // HACK!65 static void setMouseClipping_s(unsigned int width, unsigned int height)66 { instancePointer_s->setMouseClipping(width, height); }67 void setConfigValues() { }68 68 #ifdef ORXONOX_PLATFORM_LINUX 69 // HACK!70 static void grabMouse();71 static void ungrabMouse();69 // TODO: Make this a feature rather than a hack 70 void grab(); 71 void ungrab(); 72 72 #endif 73 73 74 74 private: 75 // TODO: Do we need to reset the mouse position?76 void clearBuffersImpl() { }77 78 75 //! OIS event handler 79 76 bool mousePressed(const OIS::MouseEvent &arg, OIS::MouseButtonID id) … … 92 89 bool mouseMoved(const OIS::MouseEvent &arg); 93 90 94 // HACK: 95 static Mouse* instancePointer_s; 91 void windowResized(unsigned int newWidth, unsigned int newHeight); 92 93 // Returns the class name as string 94 static std::string getClassNameImpl() { return "Mouse"; } 96 95 }; 97 96 }
Note: See TracChangeset
for help on using the changeset viewer.