home *** CD-ROM | disk | FTP | other *** search
/ Game Audio Programming / GameAudioProgramming.iso / Extras / Sensaura / SDK1.0 / data1.cab / Example_Files / DS3DDemo / Source / cdinput.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-13  |  1.6 KB  |  62 lines

  1. /*
  2.     Company:            Sensaura
  3.     Copyright:          (C) 1998
  4.  
  5.     File Name:            cdinput.h
  6.     File Description:    Header file for declaration of DirectInputObject class
  7.     Author:                Adam Philp
  8.     File Version:        1.01.000
  9.     Last Update:        16-OCT-98
  10.  
  11.     Target Compiler:    Microsoft Visual C++ Version 5.0
  12. */
  13.  
  14. #ifndef __cdinput_h                        // Sentry, use file only if it's not already included
  15. #define __cdinput_h
  16.  
  17. ///////////////////////    Included files ////////////////////////////////////////////////////////////
  18.  
  19. #include <dinput.h>
  20.  
  21. /////////////////////// Enumerators ///////////////////////////////////////////////////////////////
  22.  
  23. enum                                    // Enumerate flags representing keys to which this 
  24. {                                        // application responds
  25.     KF_SPACE        = 0x00000001,
  26.     KF_UPARROW        = 0x00000002,
  27.     KF_PAGEUP        = 0x00000004,
  28.     KF_LEFTARROW    = 0x00000008,
  29.     KF_RIGHTARROW    = 0x00000010,
  30.     KF_DOWNARROW    = 0x00000020,
  31.     KF_PAGEDOWN        = 0x00000040
  32. };
  33.  
  34. ///////////////////////    Class declarations ////////////////////////////////////////////////////////
  35.  
  36. /*
  37.     Class:                DirectInputObject
  38.     Description:        IDirectInput object support class which manages DirectInput devices
  39. */
  40.  
  41. class DirectInputObject
  42. {
  43. public:                                    // Public constructor & destructor
  44.     DirectInputObject();    
  45.     virtual ~DirectInputObject();
  46.  
  47. public:                                    // Public member functions
  48.     bool Create(HWND, HINSTANCE);
  49.     void Release();
  50.     bool Update(LPDWORD); 
  51.  
  52. public:                                    // Public data members
  53.     LPDIRECTINPUT        m_pDI;
  54.     LPDIRECTINPUTDEVICE    m_pKeyboard;
  55.  
  56. private:
  57.     DWORD TranslateKey(int nKey);
  58. };
  59.  
  60. typedef DirectInputObject* LPDIRECTINPUTOBJECT;
  61.  
  62. #endif                                    // End of sentry __cdinput_h