home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Games / ISp Sample / Source / ISp_Sample.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  3.3 KB  |  173 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        ISp_Sample.h
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Version:    xxx put version here xxx
  7.  
  8.     Copyright:    © 1999 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     File Ownership:
  11.  
  12.         DRI:                xxx put dri here xxx
  13.  
  14.         Other Contact:        xxx put other contact here xxx
  15.  
  16.         Technology:            xxx put technology here xxx
  17.  
  18.     Writers:
  19.  
  20.         (BWS)    Brent Schorsch
  21.  
  22.     Change History (most recent first):
  23.  
  24.        <SP1>      7/1/99    BWS        first checked in
  25. */
  26.  
  27. #ifndef __ISP_SAMPLE__
  28. #define __ISP_SAMPLE__
  29.  
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33.  
  34. //•    ————————————————————————————————————————    Includes
  35.  
  36. #define USE_OLD_INPUT_SPROCKET_LABELS 0
  37. #define USE_OLD_ISPNEED_STRUCT 0
  38. #include <InputSprocket.h>
  39. #include <MacTypes.h>
  40.  
  41. //•    ————————————————————————————————————————    Public Definitions
  42.  
  43. enum
  44. {
  45.     kMin_Roll            = -1000,
  46.     kMax_Roll            =  1000,
  47.     
  48.     kMin_Pitch            = -1000,
  49.     kMax_Pitch            =  1000,
  50.     
  51.     kMin_Yaw            = -1000,
  52.     kMax_Yaw            =  1000,
  53.     kIncrement_Yaw        =    50,
  54.     
  55.     kMin_Throttle        =     0,
  56.     kMax_Throttle        =  1000,
  57.     kIncrement_Throttle    =    50
  58. };
  59.  
  60. enum
  61. {
  62.     // primary needs
  63.     
  64.     kNeed_FireWeapon,
  65.     kNeed_NextWeapon,
  66.     kNeed_PreviousWeapon,
  67.     
  68.     kNeed_Roll,
  69.     kNeed_Pitch,
  70.     kNeed_Yaw,
  71.     kNeed_Throttle,
  72.     
  73.     kNeed_StartPause,
  74.     kNeed_Quit,
  75.     
  76.     // secondary needs for alternative input kinds
  77.     
  78.     kNeed_Weapon_MachineGun,
  79.     kNeed_Weapon_Cannon,
  80.     kNeed_Weapon_Laser,
  81.     kNeed_Weapon_Missle,
  82.     kNeed_Weapon_PrecisionBomb,
  83.     kNeed_Weapon_ClusterBomb,
  84.     
  85.     kNeed_Roll_AsDelta,
  86.     kNeed_Pitch_AsDelta,
  87.     kNeed_Yaw_AsDelta,
  88.     
  89.     kNeed_Yaw_Left,
  90.     kNeed_Yaw_Center,
  91.     kNeed_Yaw_Right,
  92.     
  93.     kNeed_Throttle_Min,
  94.     kNeed_Throttle_Decrease,
  95.     kNeed_Throttle_Increase,
  96.     kNeed_Throttle_Max,
  97.     
  98.     kNeed_NeedCount
  99. };
  100.  
  101. enum
  102. {
  103.     kWeapon_MachineGun,
  104.     kWeapon_Cannon,
  105.     kWeapon_Laser,
  106.     kWeapon_Missle,
  107.     kWeapon_PrecisionBomb,
  108.     kWeapon_ClusterBomb,
  109.     
  110.     kWeapon_WeaponCount
  111. };
  112.  
  113.  
  114.  
  115. //•    ————————————————————————————————————————    Public Types
  116.  
  117. struct Input_GameState
  118. {
  119.     Boolean        gameInProgress;
  120.     Boolean        gamePaused;
  121.  
  122.     Boolean        fireWeaponState;
  123.     UInt32        fireWeaponCount;
  124.     
  125.     SInt16        currentWeapon;
  126.     
  127.     SInt32        rollInput;
  128.     SInt32        pitchInput;
  129.     SInt32        yawInput;
  130.     SInt32        throttleInput;
  131.     
  132.     Fixed        deltaRoll;
  133.     Fixed        deltaPitch;
  134.     Fixed        deltaYaw;
  135. };
  136. typedef struct Input_GameState Input_GameState;
  137.  
  138. //•    ————————————————————————————————————————    Public Variables
  139.  
  140. //•    ————————————————————————————————————————    Public Functions
  141. Boolean  Input_Available (void);
  142.  
  143. OSStatus Input_Initialize (void);
  144. OSStatus Input_Terminate (void);
  145.  
  146. void    Input_InitializeState (Input_GameState * gameState);
  147.  
  148. OSStatus Input_Suspend (void);
  149. OSStatus Input_Resume (void);
  150.  
  151. void     Input_ShowConfigureDialog (void);
  152.  
  153. void     Input_GetButtonEvents (Input_GameState * gameState);
  154. void     Input_PollAxisValues (Input_GameState * gameState);
  155.  
  156.  
  157. //••• in order to implement typing, these functions must be called
  158. //••• they tell input sprocket to ignore the keyboard, and pass thru
  159. //••• keyboard events to the system (to be gotten in waitnextevent, or getosevent)
  160. void     Input_EnableKeyboardForTyping (void);
  161. void     Input_DisableKeyboardForTyping (void);
  162.  
  163. //••• in order to implement mouse ISp input, these functions must be called
  164. //••• they tell input sprocket to ignore the mouse, and pass thru
  165. //••• mouse events to the system (to move the cursor among other things)
  166. void     Input_EnableMouseForCursor (void);
  167. void     Input_DisableMouseForCursor (void);
  168. #ifdef __cplusplus
  169. }
  170. #endif
  171.  
  172. #endif
  173.