|Microsoft DirectX 9.0|
This tutorial shows you how to enumerate a joystick attached to a system and set it up for input. Code samples are based on the Joystick Sample.
The first step of setting up the Microsoft?DirectInput?system and the final step of closing it down are the same for any application and are covered in Tutorial 1: Using the Keyboard.
The first step in this tutorial is to enumerate devices; that is, to see what joysticks are available. As part of this process you initialize each joystick device and set its desired characteristics. You then use the IDirectInputDevice8 interface methods to retrieve data from each joystick.
This tutorial divides the required tasks into the following steps.