Microsoft DirectX 8.1 (Visual Basic)

Custom Forces

Application writers can create their own effects by creating a custom force. A custom force is an array of constant force values played back by the device.

To create a custom force, first define an array of magnitudes, all in the range from –10,000 through 10,000. Then pass this array to the DirectInputDevice8.CreateCustomEffect method.

Set the samplePeriod parameter and the lSamplePeriod member of the DIEFFECT type to the same value. This is the length of time, in milliseconds, for which each element in the array of forces is played.

The custom force is played repeatedly until the time set in the DIEFFECT.lDuration has elapsed.