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) {
179 #if SDL_HAPTIC_XINPUT
180 if (joystick->hwdata->bXInputHaptic) {
184 #if SDL_HAPTIC_DINPUT
185 if (joystick->hwdata->Capabilities.dwFlags & DIDC_FORCEFEEDBACK) {
201 if (joystick->hwdata->bXInputHaptic != haptic->hwdata->bXInputHaptic) {
203 }
else if (joystick->hwdata->bXInputHaptic) {
218 if (joystick->hwdata->bXInputDevice) {
231 if (haptic->hwdata) {
235 haptic->effects =
NULL;
236 haptic->neffects = 0;
239 if (haptic->hwdata->bXInputHaptic) {
247 haptic->hwdata =
NULL;
259 SDL_Haptic *hapticitem =
NULL;
262 for (hapticitem = SDL_haptics; hapticitem; hapticitem = hapticitem->next) {
263 if ((hapticitem->hwdata->bXInputHaptic) && (hapticitem->hwdata->thread)) {
267 hapticitem->hwdata->thread =
NULL;
271 for (item = SDL_hapticlist; item; item =
next) {
284 SDL_hapticlist =
NULL;
285 SDL_hapticlist_tail =
NULL;
306 if (haptic->hwdata->bXInputHaptic) {
326 if (haptic->hwdata->bXInputHaptic) {
340 if (haptic->hwdata->bXInputHaptic) {
353 if (haptic->hwdata->bXInputHaptic) {
366 if (haptic->hwdata->bXInputHaptic) {
382 if (haptic->hwdata->bXInputHaptic) {
395 if (haptic->hwdata->bXInputHaptic) {
408 if (haptic->hwdata->bXInputHaptic) {
421 if (haptic->hwdata->bXInputHaptic) {
434 if (haptic->hwdata->bXInputHaptic) {
447 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
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
SDL_JoystickDriver SDL_WINDOWS_JoystickDriver
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)
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)