diff --git a/libretro-common/include/libretro.h b/libretro-common/include/libretro.h index cf179502b22a..a2bbc1350892 100644 --- a/libretro-common/include/libretro.h +++ b/libretro-common/include/libretro.h @@ -4457,8 +4457,79 @@ enum retro_sensor_action RETRO_SENSOR_DUMMY = INT_MAX }; +enum retro_sensor_selector +{ + /** + * Returns the device's acceleration along its local X axis minus the effect of gravity, in m/s^2. + * + * Positive values mean that the device is accelerating to the right. + * assuming the user is looking at it head-on. + */ + RETRO_SENSOR_ACCELEROMETER_X, + + /** + * Returns the device's acceleration along its local Y axis minus the effect of gravity, in m/s^2. + * + * Positive values mean that the device is accelerating upwards, + * assuming the user is looking at it head-on. + */ + RETRO_SENSOR_ACCELEROMETER_Y, + + /** + * Returns the the device's acceleration along its local Z axis minus the effect of gravity, in m/s^2. + * + * Positive values indicate forward acceleration towards the user, + * assuming the user is looking at the device head-on. + */ + RETRO_SENSOR_ACCELEROMETER_Z, + + /** + * Returns the angular velocity of the device around its local X axis, in radians per second. + * + * Positive values indicate counter-clockwise rotation. + * + * @note A radian is about 57 degrees, and a full 360-degree rotation is 2*pi radians. + * @see https://developer.android.com/reference/android/hardware/SensorEvent#sensor.type_gyroscope + * for guidance on using this value to derive a device's orientation. + */ + RETRO_SENSOR_GYROSCOPE_X, + + /** + * Returns the angular velocity of the device around its local Z axis, in radians per second. + * + * Positive values indicate counter-clockwise rotation. + * + * @note A radian is about 57 degrees, and a full 360-degree rotation is 2*pi radians. + * @see https://developer.android.com/reference/android/hardware/SensorEvent#sensor.type_gyroscope + * for guidance on using this value to derive a device's orientation. + */ + RETRO_SENSOR_GYROSCOPE_Y, + + /** + * Returns the angular velocity of the device around its local Z axis, in radians per second. + * + * Positive values indicate counter-clockwise rotation. + * + * @note A radian is about 57 degrees, and a full 360-degree rotation is 2*pi radians. + * @see https://developer.android.com/reference/android/hardware/SensorEvent#sensor.type_gyroscope + * for guidance on using this value to derive a device's orientation. + */ + RETRO_SENSOR_GYROSCOPE_Z, + + /** + * Returns the ambient illuminance (light intensity) of the device's environment, in lux. + * + * @see https://en.wikipedia.org/wiki/Lux for a table of common lux values. + */ + RETRO_SENSOR_ILLUMINANCE, + RETRO_SENSOR_MAX, + + /** Dummy value to ensure sizeof(enum retro_hw_context_type) == sizeof(int). Do not use. */ + RETRO_SENSOR_SELECTOR_DUMMY=INT_MAX +}; + /** * Adjusts the state of a sensor. * @@ -7311,79 +7382,7 @@ struct retro_device_power */ int8_t percent; }; -enum retro_sensor_selector -{ - - /** - * Returns the device's acceleration along its local X axis minus the effect of gravity, in m/s^2. - * - * Positive values mean that the device is accelerating to the right. - * assuming the user is looking at it head-on. - */ - RETRO_SENSOR_ACCELEROMETER_X, - - /** - * Returns the device's acceleration along its local Y axis minus the effect of gravity, in m/s^2. - * - * Positive values mean that the device is accelerating upwards, - * assuming the user is looking at it head-on. - */ - RETRO_SENSOR_ACCELEROMETER_Y, - - /** - * Returns the the device's acceleration along its local Z axis minus the effect of gravity, in m/s^2. - * - * Positive values indicate forward acceleration towards the user, - * assuming the user is looking at the device head-on. - */ - RETRO_SENSOR_ACCELEROMETER_Z, - - /** - * Returns the angular velocity of the device around its local X axis, in radians per second. - * - * Positive values indicate counter-clockwise rotation. - * - * @note A radian is about 57 degrees, and a full 360-degree rotation is 2*pi radians. - * @see https://developer.android.com/reference/android/hardware/SensorEvent#sensor.type_gyroscope - * for guidance on using this value to derive a device's orientation. - */ - RETRO_SENSOR_GYROSCOPE_X, - /** - * Returns the angular velocity of the device around its local Z axis, in radians per second. - * - * Positive values indicate counter-clockwise rotation. - * - * @note A radian is about 57 degrees, and a full 360-degree rotation is 2*pi radians. - * @see https://developer.android.com/reference/android/hardware/SensorEvent#sensor.type_gyroscope - * for guidance on using this value to derive a device's orientation. - */ - RETRO_SENSOR_GYROSCOPE_Y, - - /** - * Returns the angular velocity of the device around its local Z axis, in radians per second. - * - * Positive values indicate counter-clockwise rotation. - * - * @note A radian is about 57 degrees, and a full 360-degree rotation is 2*pi radians. - * @see https://developer.android.com/reference/android/hardware/SensorEvent#sensor.type_gyroscope - * for guidance on using this value to derive a device's orientation. - */ - RETRO_SENSOR_GYROSCOPE_Z, - - /** - * Returns the ambient illuminance (light intensity) of the device's environment, in lux. - * - * @see https://en.wikipedia.org/wiki/Lux for a table of common lux values. - */ - RETRO_SENSOR_ILLUMINANCE, - - - RETRO_SENSOR_MAX, - - /** Dummy value to ensure sizeof(enum retro_hw_context_type) == sizeof(int). Do not use. */ - RETRO_SENSOR_SELECTOR_DUMMY=INT_MAX -}; /** @} */ /**