home *** CD-ROM | disk | FTP | other *** search
/ Programming an RTS Game with Direct3D / Programming an RTS Game with Direct3D.iso / Examples / Chapter 13 / Example 13.1 / mouse.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-06-30  |  696 b   |  37 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.         void DisableInput(int millisec);
  23.  
  24.         float m_speed;
  25.         int m_type;
  26.  
  27.     private:        
  28.         LPDIRECTINPUTDEVICE8 m_pMouseDevice;
  29.         DIMOUSESTATE m_mouseState;
  30.         IDirect3DTexture9* m_pMouseTexture;
  31.         LPD3DXSPRITE m_pSprite;
  32.         RECT m_viewport;
  33.         DWORD m_inputBlock;
  34. };
  35.  
  36.  
  37. #endif