mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-05 07:09:32 +00:00
SDL API renaming: SDL_sensor.h
Fixes https://github.com/libsdl-org/SDL/issues/6888
This commit is contained in:
@@ -536,7 +536,7 @@ typedef struct SDL_SensorEvent
|
||||
Uint32 type; /**< ::SDL_SENSORUPDATE */
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_SensorID which; /**< The instance ID of the sensor */
|
||||
float data[6]; /**< Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData() */
|
||||
float data[6]; /**< Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() */
|
||||
Uint64 sensor_timestamp; /**< The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock */
|
||||
} SDL_SensorEvent;
|
||||
|
||||
|
||||
@@ -308,8 +308,8 @@ extern "C" {
|
||||
*
|
||||
* This variable can be set to the following values:
|
||||
*
|
||||
* "0" - You'll call SDL_SensorUpdate() manually
|
||||
* "1" - SDL will automatically call SDL_SensorUpdate() (default)
|
||||
* "0" - You'll call SDL_UpdateSensors() manually
|
||||
* "1" - SDL will automatically call SDL_UpdateSensors() (default)
|
||||
*
|
||||
* This hint can be toggled on and off at runtime.
|
||||
*/
|
||||
|
||||
@@ -176,6 +176,22 @@
|
||||
#define RW_SEEK_END SDL_RW_SEEK_END
|
||||
#define RW_SEEK_SET SDL_RW_SEEK_SET
|
||||
|
||||
/* ##SDL_sensor.h */
|
||||
#define SDL_NumSensors SDL_GetNumSensors
|
||||
#define SDL_SensorClose SDL_CloseSensor
|
||||
#define SDL_SensorFromInstanceID SDL_GetSensorFromInstanceID
|
||||
#define SDL_SensorGetData SDL_GetSensorData
|
||||
#define SDL_SensorGetDeviceInstanceID SDL_GetSensorDeviceInstanceID
|
||||
#define SDL_SensorGetDeviceName SDL_GetSensorDeviceName
|
||||
#define SDL_SensorGetDeviceNonPortableType SDL_GetSensorDeviceNonPortableType
|
||||
#define SDL_SensorGetDeviceType SDL_GetSensorDeviceType
|
||||
#define SDL_SensorGetInstanceID SDL_GetSensorInstanceID
|
||||
#define SDL_SensorGetName SDL_GetSensorName
|
||||
#define SDL_SensorGetNonPortableType SDL_GetSensorNonPortableType
|
||||
#define SDL_SensorGetType SDL_GetSensorType
|
||||
#define SDL_SensorOpen SDL_OpenSensor
|
||||
#define SDL_SensorUpdate SDL_UpdateSensors
|
||||
|
||||
#else /* !SDL_ENABLE_OLD_NAMES */
|
||||
|
||||
/* ##SDL_audio.h */
|
||||
@@ -315,6 +331,22 @@
|
||||
#define RW_SEEK_END RW_SEEK_END_renamed_SDL_RW_SEEK_END
|
||||
#define RW_SEEK_SET RW_SEEK_SET_renamed_SDL_RW_SEEK_SET
|
||||
|
||||
/* ##SDL_sensor.h */
|
||||
#define SDL_NumSensors SDL_NumSensors_renamed_SDL_GetNumSensors
|
||||
#define SDL_SensorClose SDL_SensorClose_renamed_SDL_CloseSensor
|
||||
#define SDL_SensorFromInstanceID SDL_SensorFromInstanceID_renamed_SDL_GetSensorFromInstanceID
|
||||
#define SDL_SensorGetData SDL_SensorGetData_renamed_SDL_GetSensorData
|
||||
#define SDL_SensorGetDeviceInstanceID SDL_SensorGetDeviceInstanceID_renamed_SDL_GetSensorDeviceInstanceID
|
||||
#define SDL_SensorGetDeviceName SDL_SensorGetDeviceName_renamed_SDL_GetSensorDeviceName
|
||||
#define SDL_SensorGetDeviceNonPortableType SDL_SensorGetDeviceNonPortableType_renamed_SDL_GetSensorDeviceNonPortableType
|
||||
#define SDL_SensorGetDeviceType SDL_SensorGetDeviceType_renamed_SDL_GetSensorDeviceType
|
||||
#define SDL_SensorGetInstanceID SDL_SensorGetInstanceID_renamed_SDL_GetSensorInstanceID
|
||||
#define SDL_SensorGetName SDL_SensorGetName_renamed_SDL_GetSensorName
|
||||
#define SDL_SensorGetNonPortableType SDL_SensorGetNonPortableType_renamed_SDL_GetSensorNonPortableType
|
||||
#define SDL_SensorGetType SDL_SensorGetType_renamed_SDL_GetSensorType
|
||||
#define SDL_SensorOpen SDL_SensorOpen_renamed_SDL_OpenSensor
|
||||
#define SDL_SensorUpdate SDL_SensorUpdate_renamed_SDL_UpdateSensors
|
||||
|
||||
#endif /* SDL_ENABLE_OLD_NAMES */
|
||||
|
||||
#endif /* SDL_oldnames_h_ */
|
||||
|
||||
@@ -150,7 +150,7 @@ extern DECLSPEC void SDLCALL SDL_UnlockSensors(void);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_NumSensors(void);
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumSensors(void);
|
||||
|
||||
/**
|
||||
* Get the implementation dependent name of a sensor.
|
||||
@@ -160,7 +160,7 @@ extern DECLSPEC int SDLCALL SDL_NumSensors(void);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_SensorGetDeviceName(int device_index);
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetSensorDeviceName(int device_index);
|
||||
|
||||
/**
|
||||
* Get the type of a sensor.
|
||||
@@ -171,7 +171,7 @@ extern DECLSPEC const char *SDLCALL SDL_SensorGetDeviceName(int device_index);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetDeviceType(int device_index);
|
||||
extern DECLSPEC SDL_SensorType SDLCALL SDL_GetSensorDeviceType(int device_index);
|
||||
|
||||
/**
|
||||
* Get the platform dependent type of a sensor.
|
||||
@@ -182,7 +182,7 @@ extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetDeviceType(int device_index)
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SensorGetDeviceNonPortableType(int device_index);
|
||||
extern DECLSPEC int SDLCALL SDL_GetSensorDeviceNonPortableType(int device_index);
|
||||
|
||||
/**
|
||||
* Get the instance ID of a sensor.
|
||||
@@ -192,7 +192,7 @@ extern DECLSPEC int SDLCALL SDL_SensorGetDeviceNonPortableType(int device_index)
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetDeviceInstanceID(int device_index);
|
||||
extern DECLSPEC SDL_SensorID SDLCALL SDL_GetSensorDeviceInstanceID(int device_index);
|
||||
|
||||
/**
|
||||
* Open a sensor for use.
|
||||
@@ -202,7 +202,7 @@ extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetDeviceInstanceID(int device_in
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorOpen(int device_index);
|
||||
extern DECLSPEC SDL_Sensor *SDLCALL SDL_OpenSensor(int device_index);
|
||||
|
||||
/**
|
||||
* Return the SDL_Sensor associated with an instance id.
|
||||
@@ -212,7 +212,7 @@ extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorOpen(int device_index);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorFromInstanceID(SDL_SensorID instance_id);
|
||||
extern DECLSPEC SDL_Sensor *SDLCALL SDL_GetSensorFromInstanceID(SDL_SensorID instance_id);
|
||||
|
||||
/**
|
||||
* Get the implementation dependent name of a sensor
|
||||
@@ -222,7 +222,7 @@ extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorFromInstanceID(SDL_SensorID instan
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_SensorGetName(SDL_Sensor *sensor);
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetSensorName(SDL_Sensor *sensor);
|
||||
|
||||
/**
|
||||
* Get the type of a sensor.
|
||||
@@ -233,7 +233,7 @@ extern DECLSPEC const char *SDLCALL SDL_SensorGetName(SDL_Sensor *sensor);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetType(SDL_Sensor *sensor);
|
||||
extern DECLSPEC SDL_SensorType SDLCALL SDL_GetSensorType(SDL_Sensor *sensor);
|
||||
|
||||
/**
|
||||
* Get the platform dependent type of a sensor.
|
||||
@@ -243,7 +243,7 @@ extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetType(SDL_Sensor *sensor);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SensorGetNonPortableType(SDL_Sensor *sensor);
|
||||
extern DECLSPEC int SDLCALL SDL_GetSensorNonPortableType(SDL_Sensor *sensor);
|
||||
|
||||
/**
|
||||
* Get the instance ID of a sensor.
|
||||
@@ -253,7 +253,7 @@ extern DECLSPEC int SDLCALL SDL_SensorGetNonPortableType(SDL_Sensor *sensor);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetInstanceID(SDL_Sensor *sensor);
|
||||
extern DECLSPEC SDL_SensorID SDLCALL SDL_GetSensorInstanceID(SDL_Sensor *sensor);
|
||||
|
||||
/**
|
||||
* Get the current state of an opened sensor.
|
||||
@@ -267,16 +267,16 @@ extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetInstanceID(SDL_Sensor *sensor)
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SensorGetData(SDL_Sensor *sensor, float *data, int num_values);
|
||||
extern DECLSPEC int SDLCALL SDL_GetSensorData(SDL_Sensor *sensor, float *data, int num_values);
|
||||
|
||||
/**
|
||||
* Close a sensor previously opened with SDL_SensorOpen().
|
||||
* Close a sensor previously opened with SDL_OpenSensor().
|
||||
*
|
||||
* \param sensor The SDL_Sensor object to close
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SensorClose(SDL_Sensor *sensor);
|
||||
extern DECLSPEC void SDLCALL SDL_CloseSensor(SDL_Sensor *sensor);
|
||||
|
||||
/**
|
||||
* Update the current state of the open sensors.
|
||||
@@ -289,7 +289,7 @@ extern DECLSPEC void SDLCALL SDL_SensorClose(SDL_Sensor *sensor);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SensorUpdate(void);
|
||||
extern DECLSPEC void SDLCALL SDL_UpdateSensors(void);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
|
||||
Reference in New Issue
Block a user