summaryrefslogtreecommitdiff
path: root/contrib/SDL-3.2.8/src/haptic/dummy/SDL_syshaptic.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/SDL-3.2.8/src/haptic/dummy/SDL_syshaptic.c')
-rw-r--r--contrib/SDL-3.2.8/src/haptic/dummy/SDL_syshaptic.c151
1 files changed, 151 insertions, 0 deletions
diff --git a/contrib/SDL-3.2.8/src/haptic/dummy/SDL_syshaptic.c b/contrib/SDL-3.2.8/src/haptic/dummy/SDL_syshaptic.c
new file mode 100644
index 0000000..81f711f
--- /dev/null
+++ b/contrib/SDL-3.2.8/src/haptic/dummy/SDL_syshaptic.c
@@ -0,0 +1,151 @@
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_HAPTIC_DUMMY) || defined(SDL_HAPTIC_DISABLED)
24
25#include "../SDL_syshaptic.h"
26
27static bool SDL_SYS_LogicError(void)
28{
29 return SDL_SetError("Logic error: No haptic devices available.");
30}
31
32bool SDL_SYS_HapticInit(void)
33{
34 return true;
35}
36
37int SDL_SYS_NumHaptics(void)
38{
39 return 0;
40}
41
42SDL_HapticID SDL_SYS_HapticInstanceID(int index)
43{
44 SDL_SYS_LogicError();
45 return 0;
46}
47
48const char *SDL_SYS_HapticName(int index)
49{
50 SDL_SYS_LogicError();
51 return NULL;
52}
53
54bool SDL_SYS_HapticOpen(SDL_Haptic *haptic)
55{
56 return SDL_SYS_LogicError();
57}
58
59int SDL_SYS_HapticMouse(void)
60{
61 return -1;
62}
63
64bool SDL_SYS_JoystickIsHaptic(SDL_Joystick *joystick)
65{
66 return false;
67}
68
69bool SDL_SYS_HapticOpenFromJoystick(SDL_Haptic *haptic, SDL_Joystick *joystick)
70{
71 return SDL_SYS_LogicError();
72}
73
74bool SDL_SYS_JoystickSameHaptic(SDL_Haptic *haptic, SDL_Joystick *joystick)
75{
76 return false;
77}
78
79void SDL_SYS_HapticClose(SDL_Haptic *haptic)
80{
81 return;
82}
83
84void SDL_SYS_HapticQuit(void)
85{
86 return;
87}
88
89bool SDL_SYS_HapticNewEffect(SDL_Haptic *haptic,
90 struct haptic_effect *effect, const SDL_HapticEffect *base)
91{
92 return SDL_SYS_LogicError();
93}
94
95bool SDL_SYS_HapticUpdateEffect(SDL_Haptic *haptic,
96 struct haptic_effect *effect,
97 const SDL_HapticEffect *data)
98{
99 return SDL_SYS_LogicError();
100}
101
102bool SDL_SYS_HapticRunEffect(SDL_Haptic *haptic, struct haptic_effect *effect,
103 Uint32 iterations)
104{
105 return SDL_SYS_LogicError();
106}
107
108bool SDL_SYS_HapticStopEffect(SDL_Haptic *haptic, struct haptic_effect *effect)
109{
110 return SDL_SYS_LogicError();
111}
112
113void SDL_SYS_HapticDestroyEffect(SDL_Haptic *haptic, struct haptic_effect *effect)
114{
115 SDL_SYS_LogicError();
116 return;
117}
118
119int SDL_SYS_HapticGetEffectStatus(SDL_Haptic *haptic,
120 struct haptic_effect *effect)
121{
122 SDL_SYS_LogicError();
123 return -1;
124}
125
126bool SDL_SYS_HapticSetGain(SDL_Haptic *haptic, int gain)
127{
128 return SDL_SYS_LogicError();
129}
130
131bool SDL_SYS_HapticSetAutocenter(SDL_Haptic *haptic, int autocenter)
132{
133 return SDL_SYS_LogicError();
134}
135
136bool SDL_SYS_HapticPause(SDL_Haptic *haptic)
137{
138 return SDL_SYS_LogicError();
139}
140
141bool SDL_SYS_HapticResume(SDL_Haptic *haptic)
142{
143 return SDL_SYS_LogicError();
144}
145
146bool SDL_SYS_HapticStopAll(SDL_Haptic *haptic)
147{
148 return SDL_SYS_LogicError();
149}
150
151#endif // SDL_HAPTIC_DUMMY || SDL_HAPTIC_DISABLED