mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-04 00:46:25 +00:00
SDL API renaming: SDL_sensor.h
Fixes https://github.com/libsdl-org/SDL/issues/6888
This commit is contained in:
@@ -651,20 +651,20 @@ SDL3_0.0.0 {
|
||||
SDL_Error;
|
||||
SDL_LockSensors;
|
||||
SDL_UnlockSensors;
|
||||
SDL_NumSensors;
|
||||
SDL_SensorGetDeviceName;
|
||||
SDL_SensorGetDeviceType;
|
||||
SDL_SensorGetDeviceNonPortableType;
|
||||
SDL_SensorGetDeviceInstanceID;
|
||||
SDL_SensorOpen;
|
||||
SDL_SensorFromInstanceID;
|
||||
SDL_SensorGetName;
|
||||
SDL_SensorGetType;
|
||||
SDL_SensorGetNonPortableType;
|
||||
SDL_SensorGetInstanceID;
|
||||
SDL_SensorGetData;
|
||||
SDL_SensorClose;
|
||||
SDL_SensorUpdate;
|
||||
SDL_GetNumSensors;
|
||||
SDL_GetSensorDeviceName;
|
||||
SDL_GetSensorDeviceType;
|
||||
SDL_GetSensorDeviceNonPortableType;
|
||||
SDL_GetSensorDeviceInstanceID;
|
||||
SDL_OpenSensor;
|
||||
SDL_GetSensorFromInstanceID;
|
||||
SDL_GetSensorName;
|
||||
SDL_GetSensorType;
|
||||
SDL_GetSensorNonPortableType;
|
||||
SDL_GetSensorInstanceID;
|
||||
SDL_GetSensorData;
|
||||
SDL_CloseSensor;
|
||||
SDL_UpdateSensors;
|
||||
SDL_SetHintWithPriority;
|
||||
SDL_SetHint;
|
||||
SDL_ResetHint;
|
||||
|
@@ -652,20 +652,20 @@
|
||||
#define SDL_wcsdup SDL_wcsdup_REAL
|
||||
#define SDL_GameControllerRumble SDL_GameControllerRumble_REAL
|
||||
#define SDL_RumbleJoystick SDL_RumbleJoystick_REAL
|
||||
#define SDL_NumSensors SDL_NumSensors_REAL
|
||||
#define SDL_SensorGetDeviceName SDL_SensorGetDeviceName_REAL
|
||||
#define SDL_SensorGetDeviceType SDL_SensorGetDeviceType_REAL
|
||||
#define SDL_SensorGetDeviceNonPortableType SDL_SensorGetDeviceNonPortableType_REAL
|
||||
#define SDL_SensorGetDeviceInstanceID SDL_SensorGetDeviceInstanceID_REAL
|
||||
#define SDL_SensorOpen SDL_SensorOpen_REAL
|
||||
#define SDL_SensorFromInstanceID SDL_SensorFromInstanceID_REAL
|
||||
#define SDL_SensorGetName SDL_SensorGetName_REAL
|
||||
#define SDL_SensorGetType SDL_SensorGetType_REAL
|
||||
#define SDL_SensorGetNonPortableType SDL_SensorGetNonPortableType_REAL
|
||||
#define SDL_SensorGetInstanceID SDL_SensorGetInstanceID_REAL
|
||||
#define SDL_SensorGetData SDL_SensorGetData_REAL
|
||||
#define SDL_SensorClose SDL_SensorClose_REAL
|
||||
#define SDL_SensorUpdate SDL_SensorUpdate_REAL
|
||||
#define SDL_GetNumSensors SDL_GetNumSensors_REAL
|
||||
#define SDL_GetSensorDeviceName SDL_GetSensorDeviceName_REAL
|
||||
#define SDL_GetSensorDeviceType SDL_GetSensorDeviceType_REAL
|
||||
#define SDL_GetSensorDeviceNonPortableType SDL_GetSensorDeviceNonPortableType_REAL
|
||||
#define SDL_GetSensorDeviceInstanceID SDL_GetSensorDeviceInstanceID_REAL
|
||||
#define SDL_OpenSensor SDL_OpenSensor_REAL
|
||||
#define SDL_GetSensorFromInstanceID SDL_GetSensorFromInstanceID_REAL
|
||||
#define SDL_GetSensorName SDL_GetSensorName_REAL
|
||||
#define SDL_GetSensorType SDL_GetSensorType_REAL
|
||||
#define SDL_GetSensorNonPortableType SDL_GetSensorNonPortableType_REAL
|
||||
#define SDL_GetSensorInstanceID SDL_GetSensorInstanceID_REAL
|
||||
#define SDL_GetSensorData SDL_GetSensorData_REAL
|
||||
#define SDL_CloseSensor SDL_CloseSensor_REAL
|
||||
#define SDL_UpdateSensors SDL_UpdateSensors_REAL
|
||||
#define SDL_IsTablet SDL_IsTablet_REAL
|
||||
#define SDL_GetDisplayOrientation SDL_GetDisplayOrientation_REAL
|
||||
#define SDL_HasColorKey SDL_HasColorKey_REAL
|
||||
|
@@ -693,20 +693,20 @@ SDL_DYNAPI_PROC(float,SDL_expf,(float a),(a),return)
|
||||
SDL_DYNAPI_PROC(wchar_t*,SDL_wcsdup,(const wchar_t *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GameControllerRumble,(SDL_GameController *a, Uint16 b, Uint16 c, Uint32 d),(a,b,c,d),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_RumbleJoystick,(SDL_Joystick *a, Uint16 b, Uint16 c, Uint32 d),(a,b,c,d),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_NumSensors,(void),(),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_SensorGetDeviceName,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_SensorType,SDL_SensorGetDeviceType,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_SensorGetDeviceNonPortableType,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_SensorID,SDL_SensorGetDeviceInstanceID,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_Sensor*,SDL_SensorOpen,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_Sensor*,SDL_SensorFromInstanceID,(SDL_SensorID a),(a),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_SensorGetName,(SDL_Sensor *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_SensorType,SDL_SensorGetType,(SDL_Sensor *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_SensorGetNonPortableType,(SDL_Sensor *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_SensorID,SDL_SensorGetInstanceID,(SDL_Sensor *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_SensorGetData,(SDL_Sensor *a, float *b, int c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_SensorClose,(SDL_Sensor *a),(a),)
|
||||
SDL_DYNAPI_PROC(void,SDL_SensorUpdate,(void),(),)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetNumSensors,(void),(),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_GetSensorDeviceName,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_SensorType,SDL_GetSensorDeviceType,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetSensorDeviceNonPortableType,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_SensorID,SDL_GetSensorDeviceInstanceID,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_Sensor*,SDL_OpenSensor,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_Sensor*,SDL_GetSensorFromInstanceID,(SDL_SensorID a),(a),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_GetSensorName,(SDL_Sensor *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_SensorType,SDL_GetSensorType,(SDL_Sensor *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetSensorNonPortableType,(SDL_Sensor *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_SensorID,SDL_GetSensorInstanceID,(SDL_Sensor *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetSensorData,(SDL_Sensor *a, float *b, int c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_CloseSensor,(SDL_Sensor *a),(a),)
|
||||
SDL_DYNAPI_PROC(void,SDL_UpdateSensors,(void),(),)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_IsTablet,(void),(),return)
|
||||
SDL_DYNAPI_PROC(SDL_DisplayOrientation,SDL_GetDisplayOrientation,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_HasColorKey,(SDL_Surface *a),(a),return)
|
||||
|
@@ -877,7 +877,7 @@ static void SDL_PumpEventsInternal(SDL_bool push_sentinel)
|
||||
#if !SDL_SENSOR_DISABLED
|
||||
/* Check for sensor state change */
|
||||
if (SDL_update_sensors) {
|
||||
SDL_SensorUpdate();
|
||||
SDL_UpdateSensors();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1006,7 +1006,7 @@ static SDL_bool SDL_events_need_polling()
|
||||
|
||||
#if !SDL_SENSOR_DISABLED
|
||||
need_polling = need_polling ||
|
||||
(SDL_WasInit(SDL_INIT_SENSOR) && SDL_update_sensors && (SDL_NumSensors() > 0));
|
||||
(SDL_WasInit(SDL_INIT_SENSOR) && SDL_update_sensors && (SDL_GetNumSensors() > 0));
|
||||
#endif
|
||||
|
||||
return need_polling;
|
||||
|
@@ -90,7 +90,7 @@ int SDL_SensorInit(void)
|
||||
/*
|
||||
* Count the number of sensors attached to the system
|
||||
*/
|
||||
int SDL_NumSensors(void)
|
||||
int SDL_GetNumSensors(void)
|
||||
{
|
||||
int i, total_sensors = 0;
|
||||
SDL_LockSensors();
|
||||
@@ -138,7 +138,7 @@ static SDL_bool SDL_GetDriverAndSensorIndex(int device_index, SDL_SensorDriver *
|
||||
/*
|
||||
* Get the implementation dependent name of a sensor
|
||||
*/
|
||||
const char *SDL_SensorGetDeviceName(int device_index)
|
||||
const char *SDL_GetSensorDeviceName(int device_index)
|
||||
{
|
||||
SDL_SensorDriver *driver;
|
||||
const char *name = NULL;
|
||||
@@ -153,7 +153,7 @@ const char *SDL_SensorGetDeviceName(int device_index)
|
||||
return name;
|
||||
}
|
||||
|
||||
SDL_SensorType SDL_SensorGetDeviceType(int device_index)
|
||||
SDL_SensorType SDL_GetSensorDeviceType(int device_index)
|
||||
{
|
||||
SDL_SensorDriver *driver;
|
||||
SDL_SensorType type = SDL_SENSOR_INVALID;
|
||||
@@ -167,7 +167,7 @@ SDL_SensorType SDL_SensorGetDeviceType(int device_index)
|
||||
return type;
|
||||
}
|
||||
|
||||
int SDL_SensorGetDeviceNonPortableType(int device_index)
|
||||
int SDL_GetSensorDeviceNonPortableType(int device_index)
|
||||
{
|
||||
SDL_SensorDriver *driver;
|
||||
int type = -1;
|
||||
@@ -181,7 +181,7 @@ int SDL_SensorGetDeviceNonPortableType(int device_index)
|
||||
return type;
|
||||
}
|
||||
|
||||
SDL_SensorID SDL_SensorGetDeviceInstanceID(int device_index)
|
||||
SDL_SensorID SDL_GetSensorDeviceInstanceID(int device_index)
|
||||
{
|
||||
SDL_SensorDriver *driver;
|
||||
SDL_SensorID instance_id = -1;
|
||||
@@ -202,7 +202,7 @@ SDL_SensorID SDL_SensorGetDeviceInstanceID(int device_index)
|
||||
*
|
||||
* This function returns a sensor identifier, or NULL if an error occurred.
|
||||
*/
|
||||
SDL_Sensor *SDL_SensorOpen(int device_index)
|
||||
SDL_Sensor *SDL_OpenSensor(int device_index)
|
||||
{
|
||||
SDL_SensorDriver *driver;
|
||||
SDL_SensorID instance_id;
|
||||
@@ -273,7 +273,7 @@ SDL_Sensor *SDL_SensorOpen(int device_index)
|
||||
/*
|
||||
* Find the SDL_Sensor that owns this instance id
|
||||
*/
|
||||
SDL_Sensor *SDL_SensorFromInstanceID(SDL_SensorID instance_id)
|
||||
SDL_Sensor *SDL_GetSensorFromInstanceID(SDL_SensorID instance_id)
|
||||
{
|
||||
SDL_Sensor *sensor;
|
||||
|
||||
@@ -307,7 +307,7 @@ static int SDL_PrivateSensorValid(SDL_Sensor *sensor)
|
||||
/*
|
||||
* Get the friendly name of this sensor
|
||||
*/
|
||||
const char *SDL_SensorGetName(SDL_Sensor *sensor)
|
||||
const char *SDL_GetSensorName(SDL_Sensor *sensor)
|
||||
{
|
||||
if (!SDL_PrivateSensorValid(sensor)) {
|
||||
return NULL;
|
||||
@@ -319,7 +319,7 @@ const char *SDL_SensorGetName(SDL_Sensor *sensor)
|
||||
/*
|
||||
* Get the type of this sensor
|
||||
*/
|
||||
SDL_SensorType SDL_SensorGetType(SDL_Sensor *sensor)
|
||||
SDL_SensorType SDL_GetSensorType(SDL_Sensor *sensor)
|
||||
{
|
||||
if (!SDL_PrivateSensorValid(sensor)) {
|
||||
return SDL_SENSOR_INVALID;
|
||||
@@ -331,7 +331,7 @@ SDL_SensorType SDL_SensorGetType(SDL_Sensor *sensor)
|
||||
/*
|
||||
* Get the platform dependent type of this sensor
|
||||
*/
|
||||
int SDL_SensorGetNonPortableType(SDL_Sensor *sensor)
|
||||
int SDL_GetSensorNonPortableType(SDL_Sensor *sensor)
|
||||
{
|
||||
if (!SDL_PrivateSensorValid(sensor)) {
|
||||
return -1;
|
||||
@@ -343,7 +343,7 @@ int SDL_SensorGetNonPortableType(SDL_Sensor *sensor)
|
||||
/*
|
||||
* Get the instance id for this opened sensor
|
||||
*/
|
||||
SDL_SensorID SDL_SensorGetInstanceID(SDL_Sensor *sensor)
|
||||
SDL_SensorID SDL_GetSensorInstanceID(SDL_Sensor *sensor)
|
||||
{
|
||||
if (!SDL_PrivateSensorValid(sensor)) {
|
||||
return -1;
|
||||
@@ -355,7 +355,7 @@ SDL_SensorID SDL_SensorGetInstanceID(SDL_Sensor *sensor)
|
||||
/*
|
||||
* Get the current state of this sensor
|
||||
*/
|
||||
int SDL_SensorGetData(SDL_Sensor *sensor, float *data, int num_values)
|
||||
int SDL_GetSensorData(SDL_Sensor *sensor, float *data, int num_values)
|
||||
{
|
||||
if (!SDL_PrivateSensorValid(sensor)) {
|
||||
return -1;
|
||||
@@ -367,9 +367,9 @@ int SDL_SensorGetData(SDL_Sensor *sensor, float *data, int num_values)
|
||||
}
|
||||
|
||||
/*
|
||||
* Close a sensor previously opened with SDL_SensorOpen()
|
||||
* Close a sensor previously opened with SDL_OpenSensor()
|
||||
*/
|
||||
void SDL_SensorClose(SDL_Sensor *sensor)
|
||||
void SDL_CloseSensor(SDL_Sensor *sensor)
|
||||
{
|
||||
SDL_Sensor *sensorlist;
|
||||
SDL_Sensor *sensorlistprev;
|
||||
@@ -430,7 +430,7 @@ void SDL_SensorQuit(void)
|
||||
/* Stop the event polling */
|
||||
while (SDL_sensors) {
|
||||
SDL_sensors->ref_count = 1;
|
||||
SDL_SensorClose(SDL_sensors);
|
||||
SDL_CloseSensor(SDL_sensors);
|
||||
}
|
||||
|
||||
/* Quit the sensor setup */
|
||||
@@ -480,7 +480,7 @@ int SDL_PrivateSensorUpdate(Uint64 timestamp, SDL_Sensor *sensor, Uint64 sensor_
|
||||
return posted;
|
||||
}
|
||||
|
||||
void SDL_SensorUpdate(void)
|
||||
void SDL_UpdateSensors(void)
|
||||
{
|
||||
int i;
|
||||
SDL_Sensor *sensor, *next;
|
||||
@@ -509,7 +509,7 @@ void SDL_SensorUpdate(void)
|
||||
for (sensor = SDL_sensors; sensor; sensor = next) {
|
||||
next = sensor->next;
|
||||
if (sensor->ref_count <= 0) {
|
||||
SDL_SensorClose(sensor);
|
||||
SDL_CloseSensor(sensor);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user