Microsoft DirectX 8.1 (C++) |
Sets properties that define the device behavior. These properties include input buffer size and axis mode.
HRESULT SetProperty( REFGUID rguidProp, LPCDIPROPHEADER pdiph );
The dwData member can be one of the following values.
DIPROPAUTOCENTER_OFF: The device should not automatically center when the user releases the device. An application that uses force feedback should disable autocentering before playing effects.
DIPROPAUTOCENTER_ON: The device should automatically center when the user releases the device.
Not all devices support the autocenter property.
This setting applies to the entire device, so the dwHow member of the associated DIPROPDWORD structure must be set to DIPH_DEVICE.
This setting applies to the entire device, so the dwHow member of the associated DIPROPDWORD structure must be set to DIPH_DEVICE.
You can access the calibration mode property for an axis by setting the dwHow member of the DIPROPHEADER structure to DIPH_BYID or to DIPH_BYOFFSET and setting the dwObj member to the object ID or offset, respectively.
Control panel applications that set new calibration data must also invoke the IDirectInputJoyConfig::SendNotify method to notify other applications of the change in calibration. For more information on IDirectInputJoyConfig::SendNotify, see the DirectX Driver Development Kit (DDK).
Setting the calibration mode for the entire device is equivalent to setting it for each axis individually.
The dwData member of the DIPROPDWORD structure can be one of the following values:
DIPROPCALIBRATIONMODE_COOKED: DirectInput should return data after applying calibration information. This is the default mode.
DIPROPCALIBRATIONMODE_RAW: DirectInput should return raw, uncalibrated data. This mode is typically used only by Control Panel–type applications. Note that raw data might include negative values.
Setting a device into raw mode causes the dead zone, saturation, and range settings to be ignored.
This setting applies to individual device objects, so the dwHow member of the associated DIPROPHEADER structure must be set to either DIPH_BYID or DIPH_BYOFFSET.
This setting can be applied to either the entire device or to a specific axis.
The dwData member contains a gain value that is applied to all effects created on the device. The value is an integer in the range from 0 through 10,000, specifying the amount by which effect magnitudes should be scaled for the device. For example, a value of 10,000 indicates that all effect magnitudes are to be taken at face value. A value of 9,000 indicates that all effect magnitudes are to be reduced to 90% of their nominal magnitudes.
Setting a gain value is useful when an application wants to scale down the strength of all force-feedback effects uniformly, based on user preferences.
Unlike other properties, the gain can be set when the device is in an acquired state.
This setting applies to the entire device, so the dwHow member of the associated DIPROPDWORD structure must be set to DIPH_DEVICE.
The pdiph parameter must be a pointer to the diph member of a DIPROPSTRING structure.
This setting applies to the entire device, so the dwHow member of the associated DIPROPDWORD structure must be set to DIPH_DEVICE.
The pdiph parameter must be a pointer to the diph member of a DIPROPSTRING structure.
For some devices, this is a read-only property.
You cannot set a reverse range; lMax must be greater than lMin.
This setting can be applied to either the entire device or a specific axis.
If the method succeeds, the return value is DI_OK or DI_PROPNOEFFECT.
If the method fails, the return value can be one of the following error values:
DIERR_INVALIDPARAM |
DIERR_NOTINITIALIZED |
DIERR_OBJECTNOTFOUND |
DIERR_UNSUPPORTED |
The buffer size determines the amount of data that the buffer can hold between calls to the IDirectInputDevice8::GetDeviceData method before data is lost. You can set this value to 0 to indicate that the application does not read buffered data from the device. If the buffer size in the dwData member of the DIPROPDWORD structure is too large for the device to support it, then the largest possible buffer size is set.
Windows NT/2000/XP: Requires Windows® 2000.
Windows 98/Me: Requires Windows 98 or later. Available as a redistributable for Windows 98.
Header: Declared in Dinput.h.