Renamed *FromID() to *ForID()
While it makes sense to get an object pointer from an object ID, you want to get object attributes for an ID, otherwise e.g. GetNameFromID() sounds like it's a name ID, not an object ID. This is also consistent with the function naming convention in SDL2.
This commit is contained in:
@@ -461,7 +461,7 @@ SDL_gamecontroller.h has been renamed SDL_gamepad.h, and all APIs have been rena
|
||||
|
||||
The SDL_EVENT_GAMEPAD_ADDED event now provides the joystick instance ID in the which member of the cdevice event structure.
|
||||
|
||||
The functions SDL_GetGamepads(), SDL_GetGamepadNameFromID(), SDL_GetGamepadPathFromID(), SDL_GetGamepadPlayerIndexFromID(), SDL_GetGamepadGUIDFromID(), SDL_GetGamepadVendorFromID(), SDL_GetGamepadProductFromID(), SDL_GetGamepadProductVersionFromID(), and SDL_GetGamepadTypeFromID() have been added to directly query the list of available gamepads.
|
||||
The functions SDL_GetGamepads(), SDL_GetGamepadNameForID(), SDL_GetGamepadPathForID(), SDL_GetGamepadPlayerIndexForID(), SDL_GetGamepadGUIDForID(), SDL_GetGamepadVendorForID(), SDL_GetGamepadProductForID(), SDL_GetGamepadProductVersionForID(), and SDL_GetGamepadTypeForID() have been added to directly query the list of available gamepads.
|
||||
|
||||
The gamepad face buttons have been renamed from A/B/X/Y to North/South/East/West to indicate that they are positional rather than hardware-specific. You can use SDL_GetGamepadButtonLabel() to get the labels for the face buttons, e.g. A/B/X/Y or Cross/Circle/Square/Triangle. The hint SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS is ignored, and mappings that use this hint are translated correctly into positional buttons. Applications should provide a way for users to swap between South/East as their accept/cancel buttons, as this varies based on region and muscle memory. You can use an approach similar to the following to handle this:
|
||||
|
||||
@@ -624,12 +624,12 @@ The following functions have been removed:
|
||||
* SDL_GameControllerHasLED() - replaced with SDL_PROP_GAMEPAD_CAP_RGB_LED_BOOLEAN
|
||||
* SDL_GameControllerHasRumble() - replaced with SDL_PROP_GAMEPAD_CAP_RUMBLE_BOOLEAN
|
||||
* SDL_GameControllerHasRumbleTriggers() - replaced with SDL_PROP_GAMEPAD_CAP_TRIGGER_RUMBLE_BOOLEAN
|
||||
* SDL_GameControllerMappingForDeviceIndex() - replaced with SDL_GetGamepadMappingFromID()
|
||||
* SDL_GameControllerMappingForDeviceIndex() - replaced with SDL_GetGamepadMappingForID()
|
||||
* SDL_GameControllerMappingForIndex() - replaced with SDL_GetGamepadMappings()
|
||||
* SDL_GameControllerNameForIndex() - replaced with SDL_GetGamepadNameFromID()
|
||||
* SDL_GameControllerNameForIndex() - replaced with SDL_GetGamepadNameForID()
|
||||
* SDL_GameControllerNumMappings() - replaced with SDL_GetGamepadMappings()
|
||||
* SDL_GameControllerPathForIndex() - replaced with SDL_GetGamepadPathFromID()
|
||||
* SDL_GameControllerTypeForIndex() - replaced with SDL_GetGamepadTypeFromID()
|
||||
* SDL_GameControllerPathForIndex() - replaced with SDL_GetGamepadPathForID()
|
||||
* SDL_GameControllerTypeForIndex() - replaced with SDL_GetGamepadTypeForID()
|
||||
|
||||
The following symbols have been renamed:
|
||||
* SDL_CONTROLLER_AXIS_INVALID => SDL_GAMEPAD_AXIS_INVALID
|
||||
@@ -700,7 +700,7 @@ Rather than iterating over haptic devices using device index, there is a new fun
|
||||
if (haptics) {
|
||||
for (i = 0; i < num_haptics; ++i) {
|
||||
SDL_HapticID instance_id = haptics[i];
|
||||
const char *name = SDL_GetHapticNameFromID(instance_id);
|
||||
const char *name = SDL_GetHapticNameForID(instance_id);
|
||||
|
||||
SDL_Log("Haptic %" SDL_PRIu32 ": %s\n",
|
||||
instance_id, name ? name : "Unknown");
|
||||
@@ -742,7 +742,7 @@ The following functions have been renamed:
|
||||
|
||||
The following functions have been removed:
|
||||
* SDL_HapticIndex() - replaced with SDL_GetHapticID()
|
||||
* SDL_HapticName() - replaced with SDL_GetHapticNameFromID()
|
||||
* SDL_HapticName() - replaced with SDL_GetHapticNameForID()
|
||||
* SDL_HapticOpened() - replaced with SDL_GetHapticFromID()
|
||||
* SDL_NumHaptics() - replaced with SDL_GetHaptics()
|
||||
|
||||
@@ -830,11 +830,11 @@ Rather than iterating over joysticks using device index, there is a new function
|
||||
if (joysticks) {
|
||||
for (i = 0; i < num_joysticks; ++i) {
|
||||
SDL_JoystickID instance_id = joysticks[i];
|
||||
const char *name = SDL_GetJoystickNameFromID(instance_id);
|
||||
const char *path = SDL_GetJoystickPathFromID(instance_id);
|
||||
const char *name = SDL_GetJoystickNameForID(instance_id);
|
||||
const char *path = SDL_GetJoystickPathForID(instance_id);
|
||||
|
||||
SDL_Log("Joystick %" SDL_PRIu32 ": %s%s%s VID 0x%.4x, PID 0x%.4x\n",
|
||||
instance_id, name ? name : "Unknown", path ? ", " : "", path ? path : "", SDL_GetJoystickVendorFromID(instance_id), SDL_GetJoystickProductFromID(instance_id));
|
||||
instance_id, name ? name : "Unknown", path ? ", " : "", path ? path : "", SDL_GetJoystickVendorForID(instance_id), SDL_GetJoystickProductForID(instance_id));
|
||||
}
|
||||
SDL_free(joysticks);
|
||||
}
|
||||
@@ -845,7 +845,7 @@ Rather than iterating over joysticks using device index, there is a new function
|
||||
|
||||
The SDL_EVENT_JOYSTICK_ADDED event now provides the joystick instance ID in the `which` member of the jdevice event structure.
|
||||
|
||||
The functions SDL_GetJoysticks(), SDL_GetJoystickNameFromID(), SDL_GetJoystickPathFromID(), SDL_GetJoystickPlayerIndexFromID(), SDL_GetJoystickGUIDFromID(), SDL_GetJoystickVendorFromID(), SDL_GetJoystickProductFromID(), SDL_GetJoystickProductVersionFromID(), and SDL_GetJoystickTypeFromID() have been added to directly query the list of available joysticks.
|
||||
The functions SDL_GetJoysticks(), SDL_GetJoystickNameForID(), SDL_GetJoystickPathForID(), SDL_GetJoystickPlayerIndexForID(), SDL_GetJoystickGUIDForID(), SDL_GetJoystickVendorForID(), SDL_GetJoystickProductForID(), SDL_GetJoystickProductVersionForID(), and SDL_GetJoystickTypeForID() have been added to directly query the list of available joysticks.
|
||||
|
||||
SDL_AttachVirtualJoystick() now returns the joystick instance ID instead of a device index, and returns 0 if there was an error.
|
||||
|
||||
@@ -899,18 +899,18 @@ The following functions have been removed:
|
||||
* SDL_JoystickAttachVirtual() - replaced with SDL_AttachVirtualJoystick()
|
||||
* SDL_JoystickCurrentPowerLevel() - replaced with SDL_GetJoystickConnectionState() and SDL_GetJoystickPowerInfo()
|
||||
* SDL_JoystickEventState() - replaced with SDL_SetJoystickEventsEnabled() and SDL_JoystickEventsEnabled()
|
||||
* SDL_JoystickGetDeviceGUID() - replaced with SDL_GetJoystickGUIDFromID()
|
||||
* SDL_JoystickGetDeviceGUID() - replaced with SDL_GetJoystickGUIDForID()
|
||||
* SDL_JoystickGetDeviceInstanceID()
|
||||
* SDL_JoystickGetDevicePlayerIndex() - replaced with SDL_GetJoystickPlayerIndexFromID()
|
||||
* SDL_JoystickGetDeviceProduct() - replaced with SDL_GetJoystickProductFromID()
|
||||
* SDL_JoystickGetDeviceProductVersion() - replaced with SDL_GetJoystickProductVersionFromID()
|
||||
* SDL_JoystickGetDeviceType() - replaced with SDL_GetJoystickTypeFromID()
|
||||
* SDL_JoystickGetDeviceVendor() - replaced with SDL_GetJoystickVendorFromID()
|
||||
* SDL_JoystickGetDevicePlayerIndex() - replaced with SDL_GetJoystickPlayerIndexForID()
|
||||
* SDL_JoystickGetDeviceProduct() - replaced with SDL_GetJoystickProductForID()
|
||||
* SDL_JoystickGetDeviceProductVersion() - replaced with SDL_GetJoystickProductVersionForID()
|
||||
* SDL_JoystickGetDeviceType() - replaced with SDL_GetJoystickTypeForID()
|
||||
* SDL_JoystickGetDeviceVendor() - replaced with SDL_GetJoystickVendorForID()
|
||||
* SDL_JoystickHasLED() - replaced with SDL_PROP_JOYSTICK_CAP_RGB_LED_BOOLEAN
|
||||
* SDL_JoystickHasRumble() - replaced with SDL_PROP_JOYSTICK_CAP_RUMBLE_BOOLEAN
|
||||
* SDL_JoystickHasRumbleTriggers() - replaced with SDL_PROP_JOYSTICK_CAP_TRIGGER_RUMBLE_BOOLEAN
|
||||
* SDL_JoystickNameForIndex() - replaced with SDL_GetJoystickNameFromID()
|
||||
* SDL_JoystickPathForIndex() - replaced with SDL_GetJoystickPathFromID()
|
||||
* SDL_JoystickNameForIndex() - replaced with SDL_GetJoystickNameForID()
|
||||
* SDL_JoystickPathForIndex() - replaced with SDL_GetJoystickPathForID()
|
||||
* SDL_NumJoysticks() - replaced with SDL_GetJoysticks()
|
||||
* SDL_VIRTUAL_JOYSTICK_DESC_VERSION - no longer needed, version info has been removed from SDL_VirtualJoystickDesc.
|
||||
|
||||
@@ -1571,9 +1571,9 @@ Rather than iterating over sensors using device index, there is a new function S
|
||||
for (i = 0; i < num_sensors; ++i) {
|
||||
SDL_Log("Sensor %" SDL_PRIu32 ": %s, type %d, platform type %d\n",
|
||||
sensors[i],
|
||||
SDL_GetSensorNameFromID(sensors[i]),
|
||||
SDL_GetSensorTypeFromID(sensors[i]),
|
||||
SDL_GetSensorNonPortableTypeFromID(sensors[i]));
|
||||
SDL_GetSensorNameForID(sensors[i]),
|
||||
SDL_GetSensorTypeForID(sensors[i]),
|
||||
SDL_GetSensorNonPortableTypeForID(sensors[i]));
|
||||
}
|
||||
SDL_free(sensors);
|
||||
}
|
||||
@@ -1600,9 +1600,9 @@ The following functions have been removed:
|
||||
* SDL_LockSensors()
|
||||
* SDL_NumSensors() - replaced with SDL_GetSensors()
|
||||
* SDL_SensorGetDeviceInstanceID()
|
||||
* SDL_SensorGetDeviceName() - replaced with SDL_GetSensorNameFromID()
|
||||
* SDL_SensorGetDeviceNonPortableType() - replaced with SDL_GetSensorNonPortableTypeFromID()
|
||||
* SDL_SensorGetDeviceType() - replaced with SDL_GetSensorTypeFromID()
|
||||
* SDL_SensorGetDeviceName() - replaced with SDL_GetSensorNameForID()
|
||||
* SDL_SensorGetDeviceNonPortableType() - replaced with SDL_GetSensorNonPortableTypeForID()
|
||||
* SDL_SensorGetDeviceType() - replaced with SDL_GetSensorTypeForID()
|
||||
* SDL_UnlockSensors()
|
||||
|
||||
## SDL_shape.h
|
||||
|
||||
Reference in New Issue
Block a user