Go to the documentation of this file.
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) {
71 SDL_hapticlist_tail->
next = item;
72 SDL_hapticlist_tail = item;
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
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) {
239 if (
haptic->hwdata->bXInputHaptic) {
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;
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_HapticPause(SDL_Haptic *haptic)
const char * SDL_SYS_HapticName(int index)
int SDL_SYS_HapticUnpause(SDL_Haptic *haptic)
int SDL_SYS_HapticInit(void)
int SDL_SYS_HapticUpdateEffect(SDL_Haptic *haptic, struct haptic_effect *effect, SDL_HapticEffect *data)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
void SDL_SYS_HapticDestroyEffect(SDL_Haptic *haptic, struct haptic_effect *effect)
int SDL_SYS_HapticRunEffect(SDL_Haptic *haptic, struct haptic_effect *effect, Uint32 iterations)
The SDL haptic subsystem allows you to control haptic (force feedback) devices.
void SDL_SYS_HapticQuit(void)
int SDL_SYS_HapticSetGain(SDL_Haptic *haptic, int gain)
int SDL_SYS_AddHapticDevice(SDL_hapticlist_item *item)
int SDL_SYS_HapticGetEffectStatus(SDL_Haptic *haptic, struct haptic_effect *effect)
The generic template for any haptic effect.
int SDL_SYS_HapticStopEffect(SDL_Haptic *haptic, struct haptic_effect *effect)
int SDL_SYS_HapticStopAll(SDL_Haptic *haptic)
void SDL_SYS_HapticClose(SDL_Haptic *haptic)
#define SDL_assert(condition)
SDL_JoystickDriver SDL_WINDOWS_JoystickDriver
#define SDL_OutOfMemory()
struct SDL_hapticlist_item * next
int SDL_SYS_HapticOpen(SDL_Haptic *haptic)
int SDL_SYS_HapticMouse(void)
int SDL_SYS_HapticNewEffect(SDL_Haptic *haptic, struct haptic_effect *effect, SDL_HapticEffect *base)
static SDL_Haptic * haptic
int SDL_SYS_HapticSetAutocenter(SDL_Haptic *haptic, int autocenter)
int SDL_SYS_NumHaptics(void)
int SDL_SYS_RemoveHapticDevice(SDL_hapticlist_item *prev, SDL_hapticlist_item *item)
SDL_hapticlist_item * SDL_hapticlist
int SDL_SYS_JoystickIsHaptic(SDL_Joystick *joystick)
struct haptic_hweffect * hweffect
int SDL_SYS_JoystickSameHaptic(SDL_Haptic *haptic, SDL_Joystick *joystick)
int SDL_SYS_HapticOpenFromJoystick(SDL_Haptic *haptic, SDL_Joystick *joystick)