DICUSTOMFORCE

The DICUSTOMFORCE structure contains type-specific information for effects that are marked as DIEFT_CUSTOMFORCE.

The structure describes a custom or user-defined force.

A pointer to a DICUSTOMFORCE structure for an effect is passed in the lpvTypeSpecificParams member of the DIEFFECT structure.

typedef struct { 
    DWORD cChannels; 
    DWORD dwSamplePeriod; 
    DWORD cSamples; 
    LPLONG rglForceData; 
} DICUSTOMFORCE, *LPDICUSTOMFORCE; 
 
typedef const DICUSTOMFORCE *LPCDICUSTOMFORCE;
 

Members

cChannels
The number of channels (axes) affected by this force.

The first channel is applied to the first axis associated with the effect, the second to the second, and so on. If there are fewer channels than axes, then nothing is associated with the extra axes.

If there is but a single channel, then the effect will be rotated in the direction specified by the rglDirection member of the DIEFFECT structure. If there is more than one channel, then rotation is not allowed.

Not all devices support rotation of custom effects.

dwSamplePeriod
The sample period in microseconds.
cSample
The total number of samples in the rglForceData. It must be an integral multiple of the cChannels.
rglForceData
Pointer to an array of force values representing the custom force. If multiple channels are provided, then the values are interleaved. For example, if cChannels is 3, then the first element of the array belongs to the first channel, the second to the second, and the third to the third.

QuickInfo

  Windows NT: Use version 5.0 or later.
  Windows: Use Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Header: Declared in dinput.h.