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:
parent
973c8b3273
commit
4368f70ff9
32 changed files with 434 additions and 292 deletions
|
@ -393,6 +393,27 @@ SDL_Sensor *SDL_GetSensorFromInstanceID(SDL_SensorID instance_id)
|
|||
return sensor;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the properties associated with a sensor.
|
||||
*/
|
||||
SDL_PropertiesID SDL_GetSensorProperties(SDL_Sensor *sensor)
|
||||
{
|
||||
SDL_PropertiesID retval;
|
||||
|
||||
SDL_LockSensors();
|
||||
{
|
||||
CHECK_SENSOR_MAGIC(sensor, 0);
|
||||
|
||||
if (sensor->props == 0) {
|
||||
sensor->props = SDL_CreateProperties();
|
||||
}
|
||||
retval = sensor->props;
|
||||
}
|
||||
SDL_UnlockSensors();
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the friendly name of this sensor
|
||||
*/
|
||||
|
@ -500,6 +521,8 @@ void SDL_CloseSensor(SDL_Sensor *sensor)
|
|||
return;
|
||||
}
|
||||
|
||||
SDL_DestroyProperties(sensor->props);
|
||||
|
||||
sensor->driver->Close(sensor);
|
||||
sensor->hwdata = NULL;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue