Microsoft DirectX 8.1 (Visual Basic) |
Hardware drivers can support special effects that do not fit into the categories defined by Microsoft® DirectInput®. The type-specific parameters for these effects may be either hard-coded or modifiable by the application.
Microsoft® DirectX® for Microsoft Visual Basic® does not support hardware effects that require custom type-specific parameters.
The hardware vendor must provide a GUID identifying the device-specific effect. Your application then must initialize a DIEFFECT type, as with any other effect. You then pass this type, along with the GUID, to the DirectInputDevice8.CreateEffect method.
When you obtain information about a device-specific effect in a DirectInputEnumEffects enumeration, the low byte of the return value of DirectInputEnumEffects.GetType indicates into which of the predefined DirectInput effect categories (constant force, ramp force, periodic, or condition) the effect falls. If it does not fall into any of the predefined categories, the value is DIEFT_HARDWARE.
If a device-specific effect falls into one of the predefined categories, the DIEFFECT type must be initialized as it would be for a standard force of that category. For example, if the effect type is DIEFT_CONSTANTFORCE, the constantForce member must be initialized.
DirectInput passes the GUID and the DIEFFECT type to the device driver for verification. If the GUID is unknown, the device returns DIERR_DEVICENOTREG. If the GUID is known but the type-specific data is incorrect for that effect, the device returns DIERR_INVALIDPARAM.