home *** CD-ROM | disk | FTP | other *** search
/ Programming an RTS Game with Direct3D / Programming an RTS Game with Direct3D.iso / Examples / Chapter 5 / Example 5.2 / mouse.h < prev   
Encoding:
C/C++ Source or Header  |  2006-06-29  |  639 b   |  35 lines

  1. #ifndef _MOUSE
  2. #define _MOUSE
  3.  
  4. #include <d3dx9.h>
  5. #include <dinput.h>
  6. #include "debug.h"
  7. #include "intpoint.h"
  8.  
  9. class MOUSE : public INTPOINT{
  10.     public:
  11.         MOUSE();
  12.         ~MOUSE();
  13.         void InitMouse(IDirect3DDevice9* Device, HWND wnd);
  14.         bool ClickLeft();
  15.         bool ClickRight();
  16.         bool WheelUp();
  17.         bool WheelDown();
  18.         bool Over(RECT dest);
  19.         bool PressInRect(RECT dest);
  20.         void Update();
  21.         void Paint();        
  22.  
  23.         float m_speed;
  24.         int m_type;
  25.  
  26.     private:        
  27.         LPDIRECTINPUTDEVICE8 m_pMouseDevice;
  28.         DIMOUSESTATE m_mouseState;
  29.         IDirect3DTexture9* m_pMouseTexture;
  30.         LPD3DXSPRITE m_pSprite;
  31.         RECT m_viewport;
  32. };
  33.  
  34.  
  35. #endif