Path: blob/master/thirdparty/sdl/sensor/SDL_sensor_c.h
10278 views
/*1Simple DirectMedia Layer2Copyright (C) 1997-2025 Sam Lantinga <[email protected]>34This software is provided 'as-is', without any express or implied5warranty. In no event will the authors be held liable for any damages6arising from the use of this software.78Permission is granted to anyone to use this software for any purpose,9including commercial applications, and to alter it and redistribute it10freely, subject to the following restrictions:11121. The origin of this software must not be misrepresented; you must not13claim that you wrote the original software. If you use this software14in a product, an acknowledgment in the product documentation would be15appreciated but is not required.162. Altered source versions must be plainly marked as such, and must not be17misrepresented as being the original software.183. This notice may not be removed or altered from any source distribution.19*/20#include "SDL_internal.h"2122#ifndef SDL_sensor_c_h_23#define SDL_sensor_c_h_2425#ifdef SDL_THREAD_SAFETY_ANALYSIS26extern SDL_Mutex *SDL_sensor_lock;27#endif2829struct SDL_SensorDriver;3031// Useful functions and variables from SDL_sensor.c3233// Initialization and shutdown functions34extern bool SDL_InitSensors(void);35extern void SDL_QuitSensors(void);3637// Return whether the sensor system is currently initialized38extern bool SDL_SensorsInitialized(void);3940// Return whether the sensors are currently locked41extern bool SDL_SensorsLocked(void);4243// Make sure we currently have the sensors locked44extern void SDL_AssertSensorsLocked(void) SDL_ASSERT_CAPABILITY(SDL_sensor_lock);4546extern void SDL_LockSensors(void) SDL_ACQUIRE(SDL_sensor_lock);47extern void SDL_UnlockSensors(void) SDL_RELEASE(SDL_sensor_lock);4849// Function to return whether there are any sensors opened by the application50extern bool SDL_SensorsOpened(void);5152// Update an individual sensor, used by gamepad sensor fusion53extern void SDL_UpdateSensor(SDL_Sensor *sensor);5455// Internal event queueing functions56extern void SDL_SendSensorUpdate(Uint64 timestamp, SDL_Sensor *sensor, Uint64 sensor_timestamp, float *data, int num_values);5758#endif // SDL_sensor_c_h_596061