Tutorial 4: Using Force Feedback

This tutorial takes you through the process of creating, playing, and modifying a simple effect on a force feedback joystick. The effect is something like a balky chain saw that you're trying to get started. The sample code uses C++ syntax.

The preliminary step of setting up the DirectInput system and the final step of closing it down are essentially the same for any application and are covered in Tutorial 1: Using the Keyboard. However, when closing down the DirectInput force feedback system you must take the additional step of releasing any effects you have created.

The tutorial breaks down the required tasks into the following steps:

·Step 1: Enumerating Force Feedback Devices

·Step 2: Creating the DirectInput Force Feedback Device

·Step 3: Enumerating Supported Effects

·Step 4: Creating an Effect

·Step 5: Playing an Effect

·Step 6: Changing an Effect