11from .__init__ import ctypes , SDL_FUNC
22
3- SDL_SensorID = ctypes .c_uint32
3+ from .SDL_properties import SDL_PropertiesID
4+
5+ class SDL_Sensor (ctypes .Structure ):
6+ ...
7+
8+ SDL_SensorID = ctypes .c_uint32
9+
10+ SDL_STANDARD_GRAVITY = 9.80665
11+
12+ SDL_SensorType = ctypes .c_int
13+
14+ SDL_SENSOR_INVALID = - 1
15+ SDL_SENSOR_UNKNOWN = 0
16+ SDL_SENSOR_ACCEL = 1
17+ SDL_SENSOR_GYRO = 2
18+ SDL_SENSOR_ACCEL_L = 3
19+ SDL_SENSOR_GYRO_L = 4
20+ SDL_SENSOR_ACCEL_R = 5
21+ SDL_SENSOR_GYRO_R = 6
22+
23+ SDL_FUNC ("SDL_GetSensors" , ctypes .POINTER (SDL_SensorID ), ctypes .POINTER (ctypes .c_int ))
24+ SDL_FUNC ("SDL_GetSensorNameForID" , ctypes .c_char_p , SDL_SensorID )
25+ SDL_FUNC ("SDL_GetSensorTypeForID" , SDL_SensorType , SDL_SensorID )
26+ SDL_FUNC ("SDL_GetSensorNonPortableTypeForID" , ctypes .c_int , SDL_SensorID )
27+ SDL_FUNC ("SDL_OpenSensor" , ctypes .POINTER (SDL_Sensor ), SDL_SensorID )
28+ SDL_FUNC ("SDL_GetSensorFromID" , ctypes .POINTER (SDL_Sensor ), SDL_SensorID )
29+ SDL_FUNC ("SDL_GetSensorProperties" , SDL_PropertiesID , ctypes .POINTER (SDL_Sensor ))
30+ SDL_FUNC ("SDL_GetSensorName" , ctypes .c_char_p , ctypes .POINTER (SDL_Sensor ))
31+ SDL_FUNC ("SDL_GetSensorType" , SDL_SensorType , ctypes .POINTER (SDL_Sensor ))
32+ SDL_FUNC ("SDL_GetSensorNonPortableType" , ctypes .c_int , ctypes .POINTER (SDL_Sensor ))
33+ SDL_FUNC ("SDL_GetSensorID" , SDL_SensorID , ctypes .POINTER (SDL_Sensor ))
34+ SDL_FUNC ("SDL_GetSensorData" , ctypes .c_int , ctypes .POINTER (SDL_Sensor ), ctypes .POINTER (ctypes .c_float ), ctypes .c_int )
35+ SDL_FUNC ("SDL_CloseSensor" , None , ctypes .POINTER (SDL_Sensor ))
36+ SDL_FUNC ("SDL_UpdateSensors" , None )
0 commit comments