home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / graphics / directx / ffdonuts / input.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-15  |  2.3 KB  |  72 lines

  1. /*==========================================================================
  2.  *
  3.  *  Copyright (C) 1995-1996 Microsoft Corporation. All Rights Reserved.
  4.  *
  5.  *  File:       input.h
  6.  *  Content:    input functionality include file
  7.  *
  8.  *
  9.  ***************************************************************************/
  10.  
  11. #ifndef _INPUT_H
  12. #define _INPUT_H
  13.  
  14. #ifdef __cplusplus
  15. extern "C" {            /* Assume C declarations for C++ */
  16. #endif    /* __cplusplus */
  17.  
  18. //---------------------------------------------------------------------------
  19.  
  20. #include <dinput.h>
  21.  
  22. // prototypes
  23. BOOL            inputInitDirectInput(HINSTANCE hInst, HWND hWnd);
  24. void            inputCleanupDirectInput(void);
  25. BOOL CALLBACK   inputEnumDeviceProc(LPDIDEVICEINSTANCE pdidi, LPVOID pv);
  26. BOOL CALLBACK   inputEnumEffectTypeProc(LPCDIEFFECTINFO pei, LPVOID pv);
  27. BOOL            inputAcquireDevices(void);
  28. BOOL            inputCreateEffect(DWORD dwEffectFlags);
  29. DWORD           inputProcessDeviceInput(void);
  30. BOOL            inputPrepareDevice(void);
  31. BOOL            inputPlayEffect(DWORD dwEffectFlags, LONG lDirection);
  32. BOOL CALLBACK   inputForceLevelDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam,
  33.                                        LPARAM lParam);
  34.  
  35. // constants used for scaling the input device
  36. #define DEADZONE        2500            // 25% of the axis range
  37. #define RANGE_MAX       1000            // maximum positive axis value
  38. #define RANGE_MIN       -1000           // minimum negative axis value
  39. #define FF_CHILD        5000            // "Child"          gain == 50%
  40. #define FF_ADULT        7500            // "Adult"          gain == 75%
  41. #define FF_BODYBUILDER  10000           // "Bodybuilder"    gain == 100%
  42.  
  43. // "effect flags" - these are internal identifiers and in no way map to DirectInput
  44. #define EF_BOUNCE   0x00000001l
  45. #define EF_EXPLODE  0x00000002l
  46. #define EF_FIRE     0x00000004l
  47.  
  48. // "keyboard" commands - moved from original .h file
  49. #define KEY_STOP    0x00000001l
  50. #define KEY_DOWN    0x00000002l
  51. #define KEY_LEFT    0x00000004l
  52. #define KEY_RIGHT   0x00000008l
  53. #define KEY_UP      0x00000010l
  54. #define KEY_FIRE    0x00000020l
  55. #define KEY_THROW   0x00000040l
  56. #define KEY_SHIELD  0x00000080l
  57.  
  58. //---------------------------------------------------------------------------
  59.  
  60. #endif _INPUT_H
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.