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