21 #include "../../SDL_internal.h"
23 #if SDL_HAPTIC_DINPUT || SDL_HAPTIC_XINPUT
30 #include "../SDL_syshaptic.h"
32 #include "../../joystick/SDL_sysjoystick.h"
33 #include "../../joystick/windows/SDL_windowsjoystick_c.h"
34 #include "../../joystick/windows/SDL_xinputjoystick_c.h"
46 static int numhaptics = 0;
67 if (SDL_hapticlist_tail ==
NULL) {
70 SDL_hapticlist_tail->
next = item;
71 SDL_hapticlist_tail = item;
90 if (item == SDL_hapticlist_tail) {
91 SDL_hapticlist_tail = prev;
106 HapticByDevIndex(
int device_index)
110 if ((device_index < 0) || (device_index >= numhaptics)) {
114 while (device_index > 0) {
153 #if SDL_HAPTIC_DINPUT
159 if (item->capabilities.dwDevType == DI8DEVCLASS_POINTER) {
178 #if SDL_HAPTIC_XINPUT
179 if (
joystick->hwdata->bXInputHaptic) {
183 #if SDL_HAPTIC_DINPUT
184 if (
joystick->hwdata->Capabilities.dwFlags & DIDC_FORCEFEEDBACK) {
200 if (
joystick->hwdata->bXInputHaptic !=
haptic->hwdata->bXInputHaptic) {
202 }
else if (
joystick->hwdata->bXInputHaptic) {
217 if (
joystick->hwdata->bXInputDevice) {
238 if (
haptic->hwdata->bXInputHaptic) {
258 SDL_Haptic *hapticitem =
NULL;
261 for (hapticitem =
SDL_haptics; hapticitem; hapticitem = hapticitem->next) {
262 if ((hapticitem->hwdata->bXInputHaptic) && (hapticitem->hwdata->thread)) {
266 hapticitem->hwdata->thread =
NULL;
284 SDL_hapticlist_tail =
NULL;
297 effect->
hweffect = (
struct haptic_hweffect *)
305 if (
haptic->hwdata->bXInputHaptic) {
325 if (
haptic->hwdata->bXInputHaptic) {
339 if (
haptic->hwdata->bXInputHaptic) {
352 if (
haptic->hwdata->bXInputHaptic) {
365 if (
haptic->hwdata->bXInputHaptic) {
381 if (
haptic->hwdata->bXInputHaptic) {
394 if (
haptic->hwdata->bXInputHaptic) {
407 if (
haptic->hwdata->bXInputHaptic) {
420 if (
haptic->hwdata->bXInputHaptic) {
433 if (
haptic->hwdata->bXInputHaptic) {
446 if (
haptic->hwdata->bXInputHaptic) {
#define SDL_assert(condition)
#define SDL_OutOfMemory()
static SDL_Haptic * SDL_haptics
The SDL haptic subsystem allows you to control haptic (force feedback) devices.
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
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)
const char * SDL_SYS_HapticName(int index)
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)
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)
SDL_JoystickDriver SDL_WINDOWS_JoystickDriver
int SDL_SYS_AddHapticDevice(SDL_hapticlist_item *item)
SDL_hapticlist_item * SDL_hapticlist
int SDL_SYS_RemoveHapticDevice(SDL_hapticlist_item *prev, SDL_hapticlist_item *item)
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
struct SDL_hapticlist_item * next
struct haptic_hweffect * hweffect
static SDL_Haptic * haptic
static SDL_Joystick * joystick
The generic template for any haptic effect.