Simplify and cleanup DirectInput joystick backend code:

- Do not call IDirectInputDevice8_QueryInterface(device, &IID_IDirectInputDevice8,...) on DIRECTINPUTDEVICE8 device
- Get joystick VendorID and ProductID via IDirectInputDevice8_GetProperty(.., DIPROP_VIDPID, ..) call instead of messing with DIDEVICEINSTANCE.guidProduct
- Normalize HID device interface path to upper case for stable operation of XInput check
- Remove useless RawInput calls in SDL_IsXInputDevice() - just check for "IG_" string in HID device interface path that we already have

There shouldn't be any observable behavior changes.
This commit is contained in:
Dimitriy Ryazantcev
2021-05-19 17:52:08 +03:00
committed by Sam Lantinga
parent f2f759dca3
commit 73dc68a7ae
3 changed files with 172 additions and 193 deletions

View File

@@ -37,7 +37,7 @@ typedef struct JoyStick_DeviceData
BYTE SubType;
Uint8 XInputUserId;
DIDEVICEINSTANCE dxdevice;
WCHAR hidPath[MAX_PATH];
char hidPath[MAX_PATH];
struct JoyStick_DeviceData *pNext;
} JoyStick_DeviceData;