mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-03 00:18:28 +00:00
Removed SDL_HasGamepads(), SDL_HasJoysticks(), and SDL_HasSensors()
Also cleaned up logic for whether we need to poll for events: - We need to periodically poll for joysticks to handle hotplug. - We need to frequently poll for joysticks and sensors when they're open so their state can be updated
This commit is contained in:
@@ -1914,23 +1914,6 @@ int SDL_InitGamepads(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
SDL_bool SDL_HasGamepads(void)
|
||||
{
|
||||
SDL_bool retval = SDL_FALSE;
|
||||
SDL_JoystickID *joysticks = SDL_GetJoysticks(NULL);
|
||||
if (joysticks) {
|
||||
int i;
|
||||
for (i = 0; joysticks[i]; ++i) {
|
||||
if (SDL_IsGamepad(joysticks[i])) {
|
||||
retval = SDL_TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
SDL_free(joysticks);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
SDL_JoystickID *SDL_GetGamepads(int *count)
|
||||
{
|
||||
int num_joysticks = 0;
|
||||
|
Reference in New Issue
Block a user