Welcome to mirror list, hosted at ThFree Co, Russian Federation.

SDL_haptic.h « SDL2 « include « sdlew « extern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 88fee82e54911c6ccc9066d01658ad7fc12b5b6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302

#ifndef _SDL_haptic_h
#define _SDL_haptic_h

#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_joystick.h"

#include "begin_code.h"

#ifdef __cplusplus
extern "C" {
#endif

struct _SDL_Haptic;
typedef struct _SDL_Haptic SDL_Haptic;

#define SDL_HAPTIC_CONSTANT   (1<<0)

#define SDL_HAPTIC_SINE       (1<<1)

#define SDL_HAPTIC_LEFTRIGHT     (1<<2)

#define SDL_HAPTIC_TRIANGLE   (1<<3)

#define SDL_HAPTIC_SAWTOOTHUP (1<<4)

#define SDL_HAPTIC_SAWTOOTHDOWN (1<<5)

#define SDL_HAPTIC_RAMP       (1<<6)

#define SDL_HAPTIC_SPRING     (1<<7)

#define SDL_HAPTIC_DAMPER     (1<<8)

#define SDL_HAPTIC_INERTIA    (1<<9)

#define SDL_HAPTIC_FRICTION   (1<<10)

#define SDL_HAPTIC_CUSTOM     (1<<11)

#define SDL_HAPTIC_GAIN       (1<<12)

#define SDL_HAPTIC_AUTOCENTER (1<<13)

#define SDL_HAPTIC_STATUS     (1<<14)

#define SDL_HAPTIC_PAUSE      (1<<15)

#define SDL_HAPTIC_POLAR      0

#define SDL_HAPTIC_CARTESIAN  1

#define SDL_HAPTIC_SPHERICAL  2

#define SDL_HAPTIC_INFINITY   4294967295U

typedef struct SDL_HapticDirection
{
    Uint8 type;
    Sint32 dir[3];
} SDL_HapticDirection;

typedef struct SDL_HapticConstant
{

    Uint16 type;
    SDL_HapticDirection direction;

    Uint32 length;
    Uint16 delay;

    Uint16 button;
    Uint16 interval;

    Sint16 level;

    Uint16 attack_length;
    Uint16 attack_level;
    Uint16 fade_length;
    Uint16 fade_level;
} SDL_HapticConstant;

typedef struct SDL_HapticPeriodic
{

    Uint16 type;
    SDL_HapticDirection direction;

    Uint32 length;
    Uint16 delay;

    Uint16 button;
    Uint16 interval;

    Uint16 period;
    Sint16 magnitude;
    Sint16 offset;
    Uint16 phase;

    Uint16 attack_length;
    Uint16 attack_level;
    Uint16 fade_length;
    Uint16 fade_level;
} SDL_HapticPeriodic;

typedef struct SDL_HapticCondition
{

    Uint16 type;
    SDL_HapticDirection direction;

    Uint32 length;
    Uint16 delay;

    Uint16 button;
    Uint16 interval;

    Uint16 right_sat[3];
    Uint16 left_sat[3];
    Sint16 right_coeff[3];
    Sint16 left_coeff[3];
    Uint16 deadband[3];
    Sint16 center[3];
} SDL_HapticCondition;

typedef struct SDL_HapticRamp
{

    Uint16 type;
    SDL_HapticDirection direction;

    Uint32 length;
    Uint16 delay;

    Uint16 button;
    Uint16 interval;

    Sint16 start;
    Sint16 end;

    Uint16 attack_length;
    Uint16 attack_level;
    Uint16 fade_length;
    Uint16 fade_level;
} SDL_HapticRamp;

typedef struct SDL_HapticLeftRight
{

    Uint16 type;

    Uint32 length;

    Uint16 large_magnitude;
    Uint16 small_magnitude;
} SDL_HapticLeftRight;

typedef struct SDL_HapticCustom
{

    Uint16 type;
    SDL_HapticDirection direction;

    Uint32 length;
    Uint16 delay;

    Uint16 button;
    Uint16 interval;

    Uint8 channels;
    Uint16 period;
    Uint16 samples;
    Uint16 *data;

    Uint16 attack_length;
    Uint16 attack_level;
    Uint16 fade_length;
    Uint16 fade_level;
} SDL_HapticCustom;

typedef union SDL_HapticEffect
{

    Uint16 type;
    SDL_HapticConstant constant;
    SDL_HapticPeriodic periodic;
    SDL_HapticCondition condition;
    SDL_HapticRamp ramp;
    SDL_HapticLeftRight leftright;
    SDL_HapticCustom custom;
} SDL_HapticEffect;

typedef int SDLCALL tSDL_NumHaptics(void);

typedef const char * SDLCALL tSDL_HapticName(int device_index);

typedef SDL_Haptic * SDLCALL tSDL_HapticOpen(int device_index);

typedef int SDLCALL tSDL_HapticOpened(int device_index);

typedef int SDLCALL tSDL_HapticIndex(SDL_Haptic * haptic);

typedef int SDLCALL tSDL_MouseIsHaptic(void);

typedef SDL_Haptic * SDLCALL tSDL_HapticOpenFromMouse(void);

typedef int SDLCALL tSDL_JoystickIsHaptic(SDL_Joystick * joystick);

typedef SDL_Haptic * SDLCALL tSDL_HapticOpenFromJoystick(SDL_Joystick *
                                                               joystick);

typedef void SDLCALL tSDL_HapticClose(SDL_Haptic * haptic);

typedef int SDLCALL tSDL_HapticNumEffects(SDL_Haptic * haptic);

typedef int SDLCALL tSDL_HapticNumEffectsPlaying(SDL_Haptic * haptic);

extern DECLSPEC unsigned int SDLCALL SDL_HapticQuery(SDL_Haptic * haptic);

typedef int SDLCALL tSDL_HapticNumAxes(SDL_Haptic * haptic);

typedef int SDLCALL tSDL_HapticEffectSupported(SDL_Haptic * haptic,
                                                      SDL_HapticEffect *
                                                      effect);

typedef int SDLCALL tSDL_HapticNewEffect(SDL_Haptic * haptic,
                                                SDL_HapticEffect * effect);

typedef int SDLCALL tSDL_HapticUpdateEffect(SDL_Haptic * haptic,
                                                   int effect,
                                                   SDL_HapticEffect * data);

typedef int SDLCALL tSDL_HapticRunEffect(SDL_Haptic * haptic,
                                                int effect,
                                                Uint32 iterations);

typedef int SDLCALL tSDL_HapticStopEffect(SDL_Haptic * haptic,
                                                 int effect);

typedef void SDLCALL tSDL_HapticDestroyEffect(SDL_Haptic * haptic,
                                                     int effect);

typedef int SDLCALL tSDL_HapticGetEffectStatus(SDL_Haptic * haptic,
                                                      int effect);

typedef int SDLCALL tSDL_HapticSetGain(SDL_Haptic * haptic, int gain);

typedef int SDLCALL tSDL_HapticSetAutocenter(SDL_Haptic * haptic,
                                                    int autocenter);

typedef int SDLCALL tSDL_HapticPause(SDL_Haptic * haptic);

typedef int SDLCALL tSDL_HapticUnpause(SDL_Haptic * haptic);

typedef int SDLCALL tSDL_HapticStopAll(SDL_Haptic * haptic);

typedef int SDLCALL tSDL_HapticRumbleSupported(SDL_Haptic * haptic);

typedef int SDLCALL tSDL_HapticRumbleInit(SDL_Haptic * haptic);

typedef int SDLCALL tSDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length );

typedef int SDLCALL tSDL_HapticRumbleStop(SDL_Haptic * haptic);

extern tSDL_NumHaptics *SDL_NumHaptics;
extern tSDL_HapticName *SDL_HapticName;
extern tSDL_HapticOpen *SDL_HapticOpen;
extern tSDL_HapticOpened *SDL_HapticOpened;
extern tSDL_HapticIndex *SDL_HapticIndex;
extern tSDL_MouseIsHaptic *SDL_MouseIsHaptic;
extern tSDL_HapticOpenFromMouse *SDL_HapticOpenFromMouse;
extern tSDL_JoystickIsHaptic *SDL_JoystickIsHaptic;
extern tSDL_HapticOpenFromJoystick *SDL_HapticOpenFromJoystick;
extern tSDL_HapticClose *SDL_HapticClose;
extern tSDL_HapticNumEffects *SDL_HapticNumEffects;
extern tSDL_HapticNumEffectsPlaying *SDL_HapticNumEffectsPlaying;
extern tSDL_HapticNumAxes *SDL_HapticNumAxes;
extern tSDL_HapticEffectSupported *SDL_HapticEffectSupported;
extern tSDL_HapticNewEffect *SDL_HapticNewEffect;
extern tSDL_HapticUpdateEffect *SDL_HapticUpdateEffect;
extern tSDL_HapticRunEffect *SDL_HapticRunEffect;
extern tSDL_HapticStopEffect *SDL_HapticStopEffect;
extern tSDL_HapticDestroyEffect *SDL_HapticDestroyEffect;
extern tSDL_HapticGetEffectStatus *SDL_HapticGetEffectStatus;
extern tSDL_HapticSetGain *SDL_HapticSetGain;
extern tSDL_HapticSetAutocenter *SDL_HapticSetAutocenter;
extern tSDL_HapticPause *SDL_HapticPause;
extern tSDL_HapticUnpause *SDL_HapticUnpause;
extern tSDL_HapticStopAll *SDL_HapticStopAll;
extern tSDL_HapticRumbleSupported *SDL_HapticRumbleSupported;
extern tSDL_HapticRumbleInit *SDL_HapticRumbleInit;
extern tSDL_HapticRumblePlay *SDL_HapticRumblePlay;
extern tSDL_HapticRumbleStop *SDL_HapticRumbleStop;

#ifdef __cplusplus
}
#endif
#include "close_code.h"

#endif