joystick: Ensure HIDAPI is initialized before calling it

This commit is contained in:
Andrew Eikum 2019-07-31 11:14:48 -05:00
parent e149f4c4b0
commit c172f36bf4
2 changed files with 12 additions and 0 deletions

View file

@ -120,6 +120,8 @@ IsJoystick(int fd, char *namebuf, const size_t namebuflen, SDL_JoystickGUID *gui
}
#ifdef SDL_JOYSTICK_HIDAPI
SDL_HIDAPI_JoystickDriver.Init();
if (HIDAPI_IsDevicePresent(inpid.vendor, inpid.product, inpid.version)) {
/* The HIDAPI driver is taking care of this device */
return 0;