SDL_GetGamepadBindings() follows the SDL_GetStringRule

This commit is contained in:
Sam Lantinga
2024-07-19 12:47:04 -07:00
parent 93db5ef135
commit b80784fced
3 changed files with 9 additions and 7 deletions

View File

@@ -3543,7 +3543,7 @@ SDL_Gamepad *SDL_GetGamepadFromPlayerIndex(int player_index)
/*
* Get the SDL joystick layer bindings for this gamepad
*/
SDL_GamepadBinding **SDL_GetGamepadBindings(SDL_Gamepad *gamepad, int *count)
const SDL_GamepadBinding * const*SDL_GetGamepadBindings(SDL_Gamepad *gamepad, int *count)
{
SDL_GamepadBinding **bindings = NULL;
@@ -3574,7 +3574,7 @@ SDL_GamepadBinding **SDL_GetGamepadBindings(SDL_Gamepad *gamepad, int *count)
}
SDL_UnlockJoysticks();
return bindings;
return SDL_FreeLater(bindings);
}
int SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms)