1 | /* |
2 | Simple DirectMedia Layer |
3 | Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> |
4 | |
5 | This software is provided 'as-is', without any express or implied |
6 | warranty. In no event will the authors be held liable for any damages |
7 | arising from the use of this software. |
8 | |
9 | Permission is granted to anyone to use this software for any purpose, |
10 | including commercial applications, and to alter it and redistribute it |
11 | freely, subject to the following restrictions: |
12 | |
13 | 1. The origin of this software must not be misrepresented; you must not |
14 | claim that you wrote the original software. If you use this software |
15 | in a product, an acknowledgment in the product documentation would be |
16 | appreciated but is not required. |
17 | 2. Altered source versions must be plainly marked as such, and must not be |
18 | misrepresented as being the original software. |
19 | 3. This notice may not be removed or altered from any source distribution. |
20 | */ |
21 | #include "SDL_internal.h" |
22 | |
23 | #if defined(SDL_SENSOR_DUMMY) || defined(SDL_SENSOR_DISABLED) |
24 | |
25 | #include "SDL_dummysensor.h" |
26 | #include "../SDL_syssensor.h" |
27 | |
28 | static bool SDL_DUMMY_SensorInit(void) |
29 | { |
30 | return true; |
31 | } |
32 | |
33 | static int SDL_DUMMY_SensorGetCount(void) |
34 | { |
35 | return 0; |
36 | } |
37 | |
38 | static void SDL_DUMMY_SensorDetect(void) |
39 | { |
40 | } |
41 | |
42 | static const char *SDL_DUMMY_SensorGetDeviceName(int device_index) |
43 | { |
44 | return NULL; |
45 | } |
46 | |
47 | static SDL_SensorType SDL_DUMMY_SensorGetDeviceType(int device_index) |
48 | { |
49 | return SDL_SENSOR_INVALID; |
50 | } |
51 | |
52 | static int SDL_DUMMY_SensorGetDeviceNonPortableType(int device_index) |
53 | { |
54 | return -1; |
55 | } |
56 | |
57 | static SDL_SensorID SDL_DUMMY_SensorGetDeviceInstanceID(int device_index) |
58 | { |
59 | return -1; |
60 | } |
61 | |
62 | static bool SDL_DUMMY_SensorOpen(SDL_Sensor *sensor, int device_index) |
63 | { |
64 | return SDL_Unsupported(); |
65 | } |
66 | |
67 | static void SDL_DUMMY_SensorUpdate(SDL_Sensor *sensor) |
68 | { |
69 | } |
70 | |
71 | static void SDL_DUMMY_SensorClose(SDL_Sensor *sensor) |
72 | { |
73 | } |
74 | |
75 | static void SDL_DUMMY_SensorQuit(void) |
76 | { |
77 | } |
78 | |
79 | SDL_SensorDriver SDL_DUMMY_SensorDriver = { |
80 | SDL_DUMMY_SensorInit, |
81 | SDL_DUMMY_SensorGetCount, |
82 | SDL_DUMMY_SensorDetect, |
83 | SDL_DUMMY_SensorGetDeviceName, |
84 | SDL_DUMMY_SensorGetDeviceType, |
85 | SDL_DUMMY_SensorGetDeviceNonPortableType, |
86 | SDL_DUMMY_SensorGetDeviceInstanceID, |
87 | SDL_DUMMY_SensorOpen, |
88 | SDL_DUMMY_SensorUpdate, |
89 | SDL_DUMMY_SensorClose, |
90 | SDL_DUMMY_SensorQuit, |
91 | }; |
92 | |
93 | #endif // SDL_SENSOR_DUMMY || SDL_SENSOR_DISABLED |
94 | |