Added SDL hints to filter the set of game controllers reported by SDL

This commit is contained in:
Sam Lantinga
2017-08-09 11:59:29 -07:00
parent dc40018438
commit c49fa37c5b
8 changed files with 248 additions and 42 deletions

View File

@@ -428,6 +428,12 @@ EnumJoysticksCallback(const DIDEVICEINSTANCE * pdidInstance, VOID * pContext)
SDL_strlcpy((char*)guid16, pNewJoystick->joystickname, sizeof(pNewJoystick->guid.data) - 4);
}
if (SDL_IsGameControllerNameAndGUID(pNewJoystick->joystickname, pNewJoystick->guid) &&
SDL_ShouldIgnoreGameController(pNewJoystick->joystickname, pNewJoystick->guid)) {
SDL_free(pNewJoystick);
return DIENUM_CONTINUE;
}
SDL_SYS_AddJoystickDevice(pNewJoystick);
return DIENUM_CONTINUE; /* get next device, please */