21 #include "../../SDL_internal.h" 23 #if SDL_HAPTIC_DINPUT || SDL_HAPTIC_XINPUT 31 #include "../SDL_syshaptic.h" 33 #include "../../joystick/SDL_sysjoystick.h" 34 #include "../../joystick/windows/SDL_windowsjoystick_c.h" 35 #include "../../joystick/windows/SDL_xinputjoystick_c.h" 47 static int numhaptics = 0;
68 if (SDL_hapticlist_tail ==
NULL) {
69 SDL_hapticlist = SDL_hapticlist_tail = item;
71 SDL_hapticlist_tail->
next = item;
72 SDL_hapticlist_tail = item;
89 SDL_hapticlist = item->
next;
91 if (item == SDL_hapticlist_tail) {
92 SDL_hapticlist_tail = prev;
107 HapticByDevIndex(
int device_index)
111 if ((device_index < 0) || (device_index >= numhaptics)) {
115 while (device_index > 0) {
154 #if SDL_HAPTIC_DINPUT 159 for (item = SDL_hapticlist; item !=
NULL; item = item->
next) {
160 if (item->capabilities.dwDevType == DI8DEVCLASS_POINTER ) {
177 #if SDL_HAPTIC_XINPUT 182 #if SDL_HAPTIC_DINPUT 183 if (hwdata->Capabilities.dwFlags & DIDC_FORCEFEEDBACK) {
196 if (joystick->hwdata->bXInputHaptic != haptic->hwdata->bXInputHaptic) {
198 }
else if (joystick->hwdata->bXInputHaptic) {
211 if (joystick->hwdata->bXInputDevice) {
224 if (haptic->hwdata) {
228 haptic->effects =
NULL;
229 haptic->neffects = 0;
232 if (haptic->hwdata->bXInputHaptic) {
240 haptic->hwdata =
NULL;
252 SDL_Haptic *hapticitem =
NULL;
255 for (hapticitem = SDL_haptics; hapticitem; hapticitem = hapticitem->next) {
256 if ((hapticitem->hwdata->bXInputHaptic) && (hapticitem->hwdata->thread)) {
260 hapticitem->hwdata->thread =
NULL;
264 for (item = SDL_hapticlist;
item; item =
next) {
277 SDL_hapticlist =
NULL;
278 SDL_hapticlist_tail =
NULL;
299 if (haptic->hwdata->bXInputHaptic) {
319 if (haptic->hwdata->bXInputHaptic) {
333 if (haptic->hwdata->bXInputHaptic) {
346 if (haptic->hwdata->bXInputHaptic) {
359 if (haptic->hwdata->bXInputHaptic) {
375 if (haptic->hwdata->bXInputHaptic) {
388 if (haptic->hwdata->bXInputHaptic) {
401 if (haptic->hwdata->bXInputHaptic) {
414 if (haptic->hwdata->bXInputHaptic) {
427 if (haptic->hwdata->bXInputHaptic) {
440 if (haptic->hwdata->bXInputHaptic) {
int SDL_SYS_HapticOpenFromJoystick(SDL_Haptic *haptic, SDL_Joystick *joystick)
int SDL_SYS_HapticOpen(SDL_Haptic *haptic)
int SDL_SYS_HapticMouse(void)
int SDL_SYS_JoystickSameHaptic(SDL_Haptic *haptic, SDL_Joystick *joystick)
int SDL_SYS_HapticStopEffect(SDL_Haptic *haptic, struct haptic_effect *effect)
const char * SDL_SYS_HapticName(int index)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
struct joystick_hwdata * next
The SDL haptic subsystem allows you to control haptic (force feedback) devices.
int SDL_SYS_HapticUnpause(SDL_Haptic *haptic)
int SDL_SYS_NumHaptics(void)
int SDL_SYS_HapticGetEffectStatus(SDL_Haptic *haptic, struct haptic_effect *effect)
int SDL_SYS_RemoveHapticDevice(SDL_hapticlist_item *prev, SDL_hapticlist_item *item)
SDL_hapticlist_item * SDL_hapticlist
struct SDL_hapticlist_item * next
The generic template for any haptic effect.
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_JoystickIsHaptic(SDL_Joystick *joystick)
void SDL_SYS_HapticDestroyEffect(SDL_Haptic *haptic, struct haptic_effect *effect)
#define SDL_assert(condition)
#define SDL_OutOfMemory()
static SDL_Haptic * haptic
int SDL_SYS_HapticInit(void)
void SDL_SYS_HapticQuit(void)
struct haptic_hweffect * hweffect
void SDL_SYS_HapticClose(SDL_Haptic *haptic)
int SDL_SYS_HapticPause(SDL_Haptic *haptic)
struct SDL_joylist_item * item
int SDL_SYS_HapticStopAll(SDL_Haptic *haptic)
int SDL_SYS_HapticSetGain(SDL_Haptic *haptic, int gain)
int SDL_SYS_HapticRunEffect(SDL_Haptic *haptic, struct haptic_effect *effect, Uint32 iterations)
int SDL_SYS_AddHapticDevice(SDL_hapticlist_item *item)
int SDL_SYS_HapticNewEffect(SDL_Haptic *haptic, struct haptic_effect *effect, SDL_HapticEffect *base)