mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-31 17:07:39 +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:
parent
7f23d71b6a
commit
324c0b76a0
15 changed files with 64 additions and 153 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue