SDL  2.0
SDL_syshaptic.c
Go to the documentation of this file.
1 /*
2  Simple DirectMedia Layer
3  Copyright (C) 1997-2020 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_haptic.h"
26 #include "../SDL_syshaptic.h"
27 
28 
29 static int
30 SDL_SYS_LogicError(void)
31 {
32  return SDL_SetError("Logic error: No haptic devices available.");
33 }
34 
35 
36 int
38 {
39  return 0;
40 }
41 
42 int
44 {
45  return 0;
46 }
47 
48 const char *
50 {
51  SDL_SYS_LogicError();
52  return NULL;
53 }
54 
55 
56 int
57 SDL_SYS_HapticOpen(SDL_Haptic * haptic)
58 {
59  return SDL_SYS_LogicError();
60 }
61 
62 
63 int
65 {
66  return -1;
67 }
68 
69 
70 int
71 SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick)
72 {
73  return 0;
74 }
75 
76 
77 int
78 SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick)
79 {
80  return SDL_SYS_LogicError();
81 }
82 
83 
84 int
85 SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick)
86 {
87  return 0;
88 }
89 
90 
91 void
92 SDL_SYS_HapticClose(SDL_Haptic * haptic)
93 {
94  return;
95 }
96 
97 
98 void
100 {
101  return;
102 }
103 
104 
105 int
106 SDL_SYS_HapticNewEffect(SDL_Haptic * haptic,
107  struct haptic_effect *effect, SDL_HapticEffect * base)
108 {
109  return SDL_SYS_LogicError();
110 }
111 
112 
113 int
115  struct haptic_effect *effect,
117 {
118  return SDL_SYS_LogicError();
119 }
120 
121 
122 int
123 SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect,
125 {
126  return SDL_SYS_LogicError();
127 }
128 
129 
130 int
131 SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect)
132 {
133  return SDL_SYS_LogicError();
134 }
135 
136 
137 void
138 SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect)
139 {
140  SDL_SYS_LogicError();
141  return;
142 }
143 
144 
145 int
147  struct haptic_effect *effect)
148 {
149  return SDL_SYS_LogicError();
150 }
151 
152 
153 int
154 SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain)
155 {
156  return SDL_SYS_LogicError();
157 }
158 
159 
160 int
161 SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter)
162 {
163  return SDL_SYS_LogicError();
164 }
165 
166 int
167 SDL_SYS_HapticPause(SDL_Haptic * haptic)
168 {
169  return SDL_SYS_LogicError();
170 }
171 
172 int
173 SDL_SYS_HapticUnpause(SDL_Haptic * haptic)
174 {
175  return SDL_SYS_LogicError();
176 }
177 
178 int
179 SDL_SYS_HapticStopAll(SDL_Haptic * haptic)
180 {
181  return SDL_SYS_LogicError();
182 }
183 
184 #endif /* SDL_HAPTIC_DUMMY || SDL_HAPTIC_DISABLED */
185 
186 /* vi: set ts=4 sw=4 expandtab: */
SDL_SYS_HapticPause
int SDL_SYS_HapticPause(SDL_Haptic *haptic)
Uint32
uint32_t Uint32
Definition: SDL_stdinc.h:203
NULL
#define NULL
Definition: begin_code.h:167
SDL_SYS_HapticName
const char * SDL_SYS_HapticName(int index)
base
set set set set set set set set set set set set set set set set set set set set *set set set macro pixldst base
Definition: pixman-arm-simd-asm.h:108
SDL_SYS_HapticUnpause
int SDL_SYS_HapticUnpause(SDL_Haptic *haptic)
iterations
static int iterations
Definition: testsprite2.c:45
SDL_SYS_HapticInit
int SDL_SYS_HapticInit(void)
SDL_SYS_HapticUpdateEffect
int SDL_SYS_HapticUpdateEffect(SDL_Haptic *haptic, struct haptic_effect *effect, SDL_HapticEffect *data)
index
GLuint index
Definition: SDL_opengl_glext.h:663
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1974
SDL_SYS_HapticDestroyEffect
void SDL_SYS_HapticDestroyEffect(SDL_Haptic *haptic, struct haptic_effect *effect)
SDL_SYS_HapticRunEffect
int SDL_SYS_HapticRunEffect(SDL_Haptic *haptic, struct haptic_effect *effect, Uint32 iterations)
SDL_haptic.h
The SDL haptic subsystem allows you to control haptic (force feedback) devices.
SDL_SYS_HapticQuit
void SDL_SYS_HapticQuit(void)
SDL_SYS_HapticSetGain
int SDL_SYS_HapticSetGain(SDL_Haptic *haptic, int gain)
SDL_SYS_HapticGetEffectStatus
int SDL_SYS_HapticGetEffectStatus(SDL_Haptic *haptic, struct haptic_effect *effect)
SDL_HapticEffect
The generic template for any haptic effect.
Definition: SDL_haptic.h:800
SDL_SYS_HapticStopEffect
int SDL_SYS_HapticStopEffect(SDL_Haptic *haptic, struct haptic_effect *effect)
haptic_effect
Definition: SDL_syshaptic.h:30
SDL_SYS_HapticStopAll
int SDL_SYS_HapticStopAll(SDL_Haptic *haptic)
SDL_SYS_HapticClose
void SDL_SYS_HapticClose(SDL_Haptic *haptic)
SDL_SYS_HapticOpen
int SDL_SYS_HapticOpen(SDL_Haptic *haptic)
SDL_SYS_HapticMouse
int SDL_SYS_HapticMouse(void)
SDL_SYS_HapticNewEffect
int SDL_SYS_HapticNewEffect(SDL_Haptic *haptic, struct haptic_effect *effect, SDL_HapticEffect *base)
haptic
static SDL_Haptic * haptic
Definition: testhaptic.c:25
SDL_SetError
#define SDL_SetError
Definition: SDL_dynapi_overrides.h:30
SDL_SYS_HapticSetAutocenter
int SDL_SYS_HapticSetAutocenter(SDL_Haptic *haptic, int autocenter)
SDL_SYS_NumHaptics
int SDL_SYS_NumHaptics(void)
SDL_SYS_JoystickIsHaptic
int SDL_SYS_JoystickIsHaptic(SDL_Joystick *joystick)
SDL_SYS_JoystickSameHaptic
int SDL_SYS_JoystickSameHaptic(SDL_Haptic *haptic, SDL_Joystick *joystick)
SDL_SYS_HapticOpenFromJoystick
int SDL_SYS_HapticOpenFromJoystick(SDL_Haptic *haptic, SDL_Joystick *joystick)