Hr = CoCreateInstance(_uuidof(WbemLocator), So we can call VariantClear() later, even if we never had a successful IWbemClassObject::Get(). IEnumWbemClassObject* pEnumDevices = nullptr Unfortunately this information can not be found by just using DirectInputīOOL IsXInputDevice( const GUID* pGuidProductFromDirectInput ) Enum each PNP device using WMI and check each device ID to see if it contains To do this, insert this code into your DirectInput enumeration callback: #include You will need to determine which of your DirectInput devices are legacy devices, and which are XInput devices, and remove them from the enumeration of DirectInput devices. All XInput devices will show up as both XInput and DirectInput devices, but they should not be handled through DirectInput. When enumerating your DirectInput devices, all DirectInput devices will enumerate correctly. If you want your game to support legacy DirectInput devices, you may use DirectInput and XInput side by side. XInput and DirectInput Side by Sideīy supporting XInput only, your game will not work with legacy DirectInput devices. In order to test the trigger values separately, you must use XInput. The solution was to combine the triggers, setting one trigger to a positive direction and the other to a negative direction, so no user interaction is indicative to DirectInput of the "control" being at center. Older games would therefore assume user interaction. However, the Xbox controller was designed to register minimum value, not center, when the triggers are not being held. Games have always assumed that DirectInput device axes are centered when there is no user interaction with the device. The combination of the left and right triggers in DirectInput is by design. Querying for headset devices will not be available.The vibration effects will not be available.The left and right trigger buttons will act as a single button, not independently. However, some functionality provided by XInput will be missing from the DirectInput implementation: The Xbox Controller is properly enumerated on DirectInput, and can be used with the DirectInputAPIs. Using the Xbox Controller with DirectInput Future controllers released for the Xbox console (that is, steering wheels) will also work on Windows.XInput devices (that is, the Xbox controllers) will have vibration functionality only when using XInput APIs.There will be a large installed base of Xbox controllers.Both Xbox and Windows programming will use the same sets of core APIs, allowing programming to translate cross-platform much easier.XInput is easier to use and requires less setup than DirectInput.There are several advantages to using XInput over DirectInput: The APIs are available through the DirectX SDK, and the driver is available through Windows Update. XInput enables applications to receive input from the Xbox Controller for Windows. Windows Store apps do not support DirectInput. This document compares XInput and DirectInput implementations of the Xbox Controller and how to support both XInput devices and legacy DirectInput devices. See GameInput API for details on the next-generation input API supported on PC and Xbox through the Microsoft Game Development Kit (GDK).
0 Comments
Leave a Reply. |