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:
Sam Lantinga
2024-07-14 15:22:03 -07:00
parent 0cdc60666b
commit 5c875e1183
21 changed files with 215 additions and 215 deletions

View File

@@ -91,11 +91,11 @@ int main(int argc, char **argv)
for (i = 0; i < num_sensors; ++i) {
SDL_Log("Sensor %" SDL_PRIu32 ": %s, type %s, platform type %d\n",
sensors[i],
SDL_GetSensorNameFromID(sensors[i]),
GetSensorTypeString(SDL_GetSensorTypeFromID(sensors[i])),
SDL_GetSensorNonPortableTypeFromID(sensors[i]));
SDL_GetSensorNameForID(sensors[i]),
GetSensorTypeString(SDL_GetSensorTypeForID(sensors[i])),
SDL_GetSensorNonPortableTypeForID(sensors[i]));
if (SDL_GetSensorTypeFromID(sensors[i]) != SDL_SENSOR_UNKNOWN) {
if (SDL_GetSensorTypeForID(sensors[i]) != SDL_SENSOR_UNKNOWN) {
SDL_Sensor *sensor = SDL_OpenSensor(sensors[i]);
if (!sensor) {
SDL_Log("Couldn't open sensor %" SDL_PRIu32 ": %s\n", sensors[i], SDL_GetError());