home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / XenonSource.exe / gamesystem / includes / gs_mouse.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-29  |  1.1 KB  |  60 lines

  1. //-------------------------------------------------------------
  2. //
  3. // Module:    gsCMouse
  4. //
  5. // Author:    John M Phillips
  6. //
  7. // Started:    12/03/00
  8. //
  9. // Base:    gsCInput
  10. //
  11. // Derived:    None
  12. //
  13. //-------------------------------------------------------------
  14.  
  15. #ifndef _INCLUDE_GS_MOUSE_H
  16. #define _INCLUDE_GS_MOUSE_H
  17.  
  18. #include "gs_input.h"
  19. #include "gs_point.h"
  20.  
  21. //-------------------------------------------------------------
  22.  
  23. typedef enum {
  24.     gsMOUSE_LEFT = 0,
  25.     gsMOUSE_RIGHT,
  26.     gsMOUSE_MIDDLE,
  27.  
  28.     gsMOUSE_NUM_BUTTONS
  29. } gsMouseButton;
  30.  
  31. //-------------------------------------------------------------
  32.  
  33. class gsCMouse : public gsCInput
  34. {
  35.     private:
  36.         
  37.         static gsLPDIRECTINPUTDEVICE m_mouse_device;
  38.         
  39.         gsCPoint m_position;
  40.         bool m_buttons[gsMOUSE_NUM_BUTTONS];
  41.  
  42.     public:
  43.         gsCMouse();
  44.         virtual ~gsCMouse();
  45.  
  46.         bool create();
  47.         bool destroy();
  48.  
  49.         bool acquire();
  50.         bool update();
  51.         bool isActive();
  52.  
  53.         gsCPoint getPosition();
  54.         bool testButton(gsMouseButton button);
  55. };
  56.  
  57. //-------------------------------------------------------------
  58.  
  59. #endif
  60.