Gain

You may want to scale the force of your effects according to the actual force exerted by different devices. For example, if an application's effects feel right on a device that puts out a maximum force of n newtons on a given axis, then you may want to adjust the gain for a device that puts out more force. (You cannot use the gain to increase the maximum force of the axis, so you should set the basic effect magnitudes to values suitable for devices that put out less force.)

The actual force generated by a device object such as an axis or button is returned in the dwFFMaxForce member of the DIDEVICEOBJECTINSTANCE structure when objects are enumerated. (See Device Object Enumeration.)

You can set the gain for the entire device by using the IDirectInputDevice::SetProperty method. You can also set the gain for individual effects when creating or modifying them. Put the new gain value in the dwGain member of the DIEFFECT structure. If modifying the effect with the SetProperty method, be sure to include DIEP_GAIN in the flags parameter.

The purpose of setting the device gain is to allow your application to have control over the strength of all effects all at once. For example, you might have a slider control in your application to allow the user to specify how strong the force feedback effects should be, like the master volume control on a sound mixer. By setting the device gain, your application won't need to adjust the gain of each individual effect to suit the user's preferences.

A gain value may be in the range 0 to 10,000 (or DI_FFNOMINALMAX), where 10,000 indicates that magnitudes are not to be scaled, 7,500 means that forces are to be scaled to 75 percent of their nominal magnitudes, and so on.