|Microsoft DirectX 9.0|
The first step toward creating an action map is the definition of the game actions. These actions are specific to the application and are defined by the developer. In the case of this example, the actions chosen reflect its needs as a space combat simulator. These values can be defined in many ways as the developer sees fit. They could be defined as an enumeration, as in the Preparing the Action Map overview, or they could be defined as constants as in this code fragment.
#define INPUT_LEFTRIGHT_AXIS 1L #define INPUT_UPDOWN_AXIS 2L #define INPUT_TURNLEFT 3L #define INPUT_TURNRIGHT 4L #define INPUT_FORWARDTHRUST 5L #define INPUT_REVERSETHRUST 6L #define INPUT_FIREWEAPONS 7L #define INPUT_ENABLESHIELD 8L #define INPUT_DISPLAYGAMEMENU 9L #define INPUT_QUITGAME 10L
Once these values are defined, they can be assigned to genre-specific action-mapping constants. This is done in Step 2: Defining the Action Map.