mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-30 23:18:29 +00:00
Added properties to various SDL objects
The following objects now have properties that can be user modified: * SDL_AudioStream * SDL_Gamepad * SDL_Joystick * SDL_RWops * SDL_Renderer * SDL_Sensor * SDL_Surface * SDL_Texture * SDL_Window
This commit is contained in:
@@ -1213,6 +1213,27 @@ SDL_Joystick *SDL_GetJoystickFromPlayerIndex(int player_index)
|
||||
return joystick;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the properties associated with a joystick
|
||||
*/
|
||||
SDL_PropertiesID SDL_GetJoystickProperties(SDL_Joystick *joystick)
|
||||
{
|
||||
SDL_PropertiesID retval;
|
||||
|
||||
SDL_LockJoysticks();
|
||||
{
|
||||
CHECK_JOYSTICK_MAGIC(joystick, 0);
|
||||
|
||||
if (joystick->props == 0) {
|
||||
joystick->props = SDL_CreateProperties();
|
||||
}
|
||||
retval = joystick->props;
|
||||
}
|
||||
SDL_UnlockJoysticks();
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the friendly name of this joystick
|
||||
*/
|
||||
@@ -1465,6 +1486,8 @@ void SDL_CloseJoystick(SDL_Joystick *joystick)
|
||||
return;
|
||||
}
|
||||
|
||||
SDL_DestroyProperties(joystick->props);
|
||||
|
||||
if (joystick->rumble_expiration) {
|
||||
SDL_RumbleJoystick(joystick, 0, 0, 0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user