home *** CD-ROM | disk | FTP | other *** search
/ Programming an RTS Game with Direct3D / Programming an RTS Game with Direct3D.iso / Examples / Chapter 12 / Example 12.4 / mouse.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-06-30  |  652 b   |  34 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.     friend class CAMERA;
  11.     public:
  12.         MOUSE();
  13.         ~MOUSE();
  14.         void InitMouse(IDirect3DDevice9* Dev, HWND wnd);
  15.         bool ClickLeft();
  16.         bool ClickRight();
  17.         bool WheelUp();
  18.         bool WheelDown();
  19.         bool Over(RECT dest);
  20.         bool PressInRect(RECT dest);
  21.         void Update();
  22.         void Paint();
  23.  
  24.     private:
  25.         IDirect3DDevice9* m_pDevice;
  26.         LPDIRECTINPUTDEVICE8 m_pMouseDevice;
  27.         DIMOUSESTATE m_mouseState;
  28.         IDirect3DTexture9* m_pMouseTexture;
  29.         LPD3DXSPRITE m_pSprite;
  30.         RECT m_viewport;
  31. };
  32.  
  33.  
  34. #endif