DirectX SDK

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.

[C++]

The type-specific structure for custom waveform effects is DICUSTOMFORCE.

Set the dwSamplePeriod member of the DICUSTOMFORCE structure and the dwSamplePeriod member of the DIEFFECT structure 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 dwDuration member of the DIEFFECT structure has elapsed.

[Visual Basic]

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 DirectInputDevice.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.