00001 #ifndef MOUSE_H 00002 #define MOUSE_H 00003 00004 #pragma once 00005 #include "InputDevice.h" 00006 #include "InputDeviceState.h" 00007 00009 00012 class CMouse : public CInputDevice, public CInputDeviceState 00013 { 00014 CREATOR(CInputEngine); 00015 00016 protected: 00017 CMouse(); 00018 virtual ~CMouse(); 00019 00024 virtual int Create(); 00029 virtual void Destroy(); 00034 virtual UINT Poll(); 00035 00036 public: 00042 bool IsButtonDown(UINT uiButtonIndex); 00048 bool IsButtonUp(UINT uiButtonIndex); 00054 UINT GetKeyState(UINT uiKeyIndex); 00059 tVERTEX2d& GetCursorPos(); 00064 tVERTEX2d& GetPrevCursorPos(); 00069 void SetCursorPos(int x, int y); 00074 virtual bool IsOfType(eEntityType eType); 00075 00076 protected: 00077 tVERTEX2d m_CursorPos; 00078 tVERTEX2d m_PrevCursorPos; 00080 tVERTEX2d m_CursorSpeed; 00082 #ifdef DIRECT_INPUT 00083 DIMOUSESTATE2 m_MouseState; 00084 #endif 00085 }; 00086 00087 #endif