home *** CD-ROM | disk | FTP | other *** search
/ Programming an RTS Game with Direct3D / Programming an RTS Game with Direct3D.iso / Examples / Chapter 15 / Example 15.1 / mouse.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-06-30  |  786 b   |  41 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. #include "mesh.h"
  9.  
  10. class MOUSE : public INTPOINT{
  11.     friend class CAMERA;
  12.     public:
  13.         MOUSE();
  14.         ~MOUSE();
  15.         void InitMouse(IDirect3DDevice9* Dev, HWND wnd);
  16.         bool ClickLeft();
  17.         bool ClickRight();
  18.         bool WheelUp();
  19.         bool WheelDown();
  20.         bool Over(RECT dest);
  21.         bool PressInRect(RECT dest);
  22.         void Update();
  23.         void Paint();
  24.         void DisableInput(int millisec);
  25.  
  26.         float m_fSpeed;
  27.         int m_iType;
  28.         INTPOINT m_mappos;
  29.  
  30.     private:
  31.         IDirect3DDevice9* m_pDevice;
  32.         LPDIRECTINPUTDEVICE8 m_pMouseDevice;
  33.         DIMOUSESTATE m_mouseState;
  34.         IDirect3DTexture9* m_pMouseTexture;
  35.         LPD3DXSPRITE m_pSprite;
  36.         RECT m_viewport;
  37.         DWORD m_dwBlock;
  38. };
  39.  
  40.  
  41. #endif