Microsoft DirectX 8.1 (Visual Basic)

Changing an Effect

You can modify the parameters of an effect, in some cases even while the effect is playing. Do this by using the DirectInputEffect.SetParameters method.

To find which effect parameters can be changed while an effect is playing, call the DirectInputEnumEffects.GetDynamicParams method.

If you attempt to modify an effect parameter that cannot be modified while the effect is playing, and the effect is still playing, Microsoft® DirectInput® normally stops the effect, updates the parameters, and restarts the effect. You can override this default behavior by passing the DIEP_NORESTART flag to SetParameters.

The following code example changes the magnitude of a constant force represented by the DirectInputEffect object dieff, which was created using the global DIEFFECT type effectinfo:

effectinfo.constantForce.lMagnitude = 5000
Call dieff.SetParameters(effectinfo, DIEP_TYPESPECIFICPARAMS)

Note  You must set the DIEP_TYPESPECIFICPARAMS flag if you are changing the condition, constantforce, periodicforce, or rampforce members of DIEFFECT.