/* ========================================================================== * ÀÛ ¼º ÀÚ : À̼ø±Ô * ÀÛ ¼º ÀÏ : 2006.12.17 * ³» ¿ë : ¸¶¿ì½º Áß°³ÀÚ * ÁÖÀÇ»çÇ× : *===========================================================================*/ #pragma once /// ¸¶¿ì½º Áß°³ÀÚ class cMouseAgent { static cMouseAgent* mSingleton; public: cMouseAgent(); ~cMouseAgent(); /// ó¸® void Process(); /// ¸¶¿ì½º ¸Þ½ÃÁö ó¸® ÇÔ¼ö /// À©µµ¿ì ¸Þ½ÃÁö ó¸® ÇÔ¼ö¿¡ ÀÇÇØ ÀÚµ¿À¸·Î È£ÃâµÈ´Ù. void SetLButtonDown( int x, int y ); void SetLButtonUp( int x, int y ); void SetRButtonDown( int x, int y ); void SetRButtonUp( int x, int y ); void SetMButtonDown( int x, int y ); void SetMButtonUp( int x, int y ); void SetPosition( int x, int y ); void SetDeltaWheel( float dw ); /// ¸¶¿ì½º ÁÂÇ¥¸¦ ¹Ýȯ int GetX() const; int GetY() const; int GetDeltaX() const; int GetDeltaY() const; /// ¿ÞÂÊ ¸¶¿ì½º ¹öưÀÌ ´­·È´ÂÁö ¿©ºÎ¸¦ ¹Ýȯ bool IsLButtonDown() const; bool IsLButtonUp() const; /// ¿À¸¥ÂÊ ¸¶¿ì½º ¹öưÀÌ ´­·È´ÂÁö ¿©ºÎ¸¦ ¹Ýȯ bool IsRButtonDown() const; bool IsRButtonUp() const; /// °¡¿îµ¥ ¸¶¿ì½º ¹öưÀÌ ´­·È´ÂÁö ¿©ºÎ¸¦ ¹Ýȯ bool IsMButtonDown() const; bool IsMButtonUp() const; /// ¸¶¿ì½º ÈÙ°ª float GetWheel() const; float GetDeltaWheel() const; public: /// ´ÜÀÏü¸¦ ¸®ÅÏ static cMouseAgent* GetSingleton(); protected: /// ¸¶¿ì½º »óÅ bool mLeft; bool mRight; bool mMiddle; /// ¸¶¿ì½º À§Ä¡ int mX; int mY; int mOldX; int mOldY; int mDeltaX; int mDeltaY; /// ¸¶¿ì½º ÈÙ °ª [-1.0, 1.0] float mWheel; float mOldWheel; float mDeltaWheel; }; inline int cMouseAgent::GetX() const { return mX; } inline int cMouseAgent::GetY() const { return mY; } inline int cMouseAgent::GetDeltaX() const { return mDeltaX; } inline int cMouseAgent::GetDeltaY() const { return mDeltaY; } inline bool cMouseAgent::IsLButtonDown() const { return mLeft; } inline bool cMouseAgent::IsLButtonUp() const { return !mLeft; } inline bool cMouseAgent::IsRButtonDown() const { return mRight; } inline bool cMouseAgent::IsRButtonUp() const { return !mRight; } inline bool cMouseAgent::IsMButtonDown() const { return mMiddle; } inline bool cMouseAgent::IsMButtonUp() const { return !mMiddle; } inline float cMouseAgent::GetWheel() const { return mWheel; } inline float cMouseAgent::GetDeltaWheel() const { return mDeltaWheel; } inline cMouseAgent* cMouseAgent::GetSingleton() { return mSingleton; } #define MOUSE cMouseAgent::GetSingleton()