SDL_xinputhaptic.c
Go to the documentation of this file.
/*
Simple DirectMedia Layer
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "../../SDL_internal.h"
#include "SDL_error.h"
#include "SDL_haptic.h"
#include "../SDL_syshaptic.h"
#if SDL_HAPTIC_XINPUT
#include "SDL_assert.h"
#include "SDL_hints.h"
#include "SDL_timer.h"
#include "SDL_windowshaptic_c.h"
#include "SDL_xinputhaptic_c.h"
#include "../../core/windows/SDL_xinput.h"
#include "../../joystick/windows/SDL_windowsjoystick_c.h"
#include "../../thread/SDL_systhread.h"
/*
* Internal stuff.
*/
static SDL_bool loaded_xinput = SDL_FALSE;
int
SDL_XINPUT_HapticInit(void)
{
if (SDL_GetHintBoolean(SDL_HINT_XINPUT_ENABLED, SDL_TRUE)) {
loaded_xinput = (WIN_LoadXInputDLL() == 0);
}
if (loaded_xinput) {
DWORD i;
for (i = 0; i < XUSER_MAX_COUNT; i++) {
SDL_XINPUT_MaybeAddDevice(i);
}
}
return 0;
}
int
SDL_XINPUT_MaybeAddDevice(const DWORD dwUserid)
{
const Uint8 userid = (Uint8)dwUserid;
SDL_hapticlist_item *item;
XINPUT_VIBRATION state;
if ((!loaded_xinput) || (dwUserid >= XUSER_MAX_COUNT)) {
return -1;
}
/* Make sure we don't already have it */
for (item = SDL_hapticlist; item; item = item->next) {
if (item->bXInputHaptic && item->userid == userid) {
return -1; /* Already added */
}
}
SDL_zero(state);
if (XINPUTSETSTATE(dwUserid, &state) != ERROR_SUCCESS) {
return -1; /* no force feedback on this device. */
}
item = (SDL_hapticlist_item *)SDL_malloc(sizeof(SDL_hapticlist_item));
if (item == NULL) {
return SDL_OutOfMemory();
}
SDL_zerop(item);
/* !!! FIXME: I'm not bothering to query for a real name right now (can we even?) */
{
char buf[64];
SDL_snprintf(buf, sizeof(buf), "XInput Controller #%u", (unsigned int)(userid + 1));
item->name = SDL_strdup(buf);
}
if (!item->name) {
SDL_free(item);
return -1;
}
/* Copy the instance over, useful for creating devices. */
item->bXInputHaptic = SDL_TRUE;
item->userid = userid;
return SDL_SYS_AddHapticDevice(item);
}
int
SDL_XINPUT_MaybeRemoveDevice(const DWORD dwUserid)
{
const Uint8 userid = (Uint8)dwUserid;
SDL_hapticlist_item *item;
SDL_hapticlist_item *prev = NULL;
if ((!loaded_xinput) || (dwUserid >= XUSER_MAX_COUNT)) {
return -1;
}
for (item = SDL_hapticlist; item != NULL; item = item->next) {
if (item->bXInputHaptic && item->userid == userid) {
/* found it, remove it. */
return SDL_SYS_RemoveHapticDevice(prev, item);
}
prev = item;
}
return -1;
}
/* !!! FIXME: this is a hack, remove this later. */
/* Since XInput doesn't offer a way to vibrate for X time, we hook into
* SDL_PumpEvents() to check if it's time to stop vibrating with some
* frequency.
* In practice, this works for 99% of use cases. But in an ideal world,
* we do this in a separate thread so that:
* - we aren't bound to when the app chooses to pump the event queue.
* - we aren't adding more polling to the event queue
* - we can emulate all the haptic effects correctly (start on a delay,
* mix multiple effects, etc).
*
* Mostly, this is here to get rumbling to work, and all the other features
* are absent in the XInput path for now. :(
*/
static int SDLCALL
SDL_RunXInputHaptic(void *arg)
{
struct haptic_hwdata *hwdata = (struct haptic_hwdata *) arg;
while (!SDL_AtomicGet(&hwdata->stopThread)) {
SDL_Delay(50);
SDL_LockMutex(hwdata->mutex);
/* If we're currently running and need to stop... */
if (hwdata->stopTicks) {
if ((hwdata->stopTicks != SDL_HAPTIC_INFINITY) && SDL_TICKS_PASSED(SDL_GetTicks(), hwdata->stopTicks)) {
XINPUT_VIBRATION vibration = { 0, 0 };
hwdata->stopTicks = 0;
XINPUTSETSTATE(hwdata->userid, &vibration);
}
}
SDL_UnlockMutex(hwdata->mutex);
}
return 0;
}
static int
SDL_XINPUT_HapticOpenFromUserIndex(SDL_Haptic *haptic, const Uint8 userid)
{
char threadName[32];
XINPUT_VIBRATION vibration = { 0, 0 }; /* stop any current vibration */
XINPUTSETSTATE(userid, &vibration);
haptic->supported = SDL_HAPTIC_LEFTRIGHT;
haptic->neffects = 1;
haptic->nplaying = 1;
/* Prepare effects memory. */
haptic->effects = (struct haptic_effect *)
SDL_malloc(sizeof(struct haptic_effect) * haptic->neffects);
if (haptic->effects == NULL) {
return SDL_OutOfMemory();
}
/* Clear the memory */
SDL_memset(haptic->effects, 0,
sizeof(struct haptic_effect) * haptic->neffects);
haptic->hwdata = (struct haptic_hwdata *) SDL_malloc(sizeof(*haptic->hwdata));
if (haptic->hwdata == NULL) {
SDL_free(haptic->effects);
haptic->effects = NULL;
return SDL_OutOfMemory();
}
SDL_memset(haptic->hwdata, 0, sizeof(*haptic->hwdata));
haptic->hwdata->bXInputHaptic = 1;
haptic->hwdata->userid = userid;
haptic->hwdata->mutex = SDL_CreateMutex();
if (haptic->hwdata->mutex == NULL) {
SDL_free(haptic->effects);
SDL_free(haptic->hwdata);
haptic->effects = NULL;
return SDL_SetError("Couldn't create XInput haptic mutex");
}
SDL_snprintf(threadName, sizeof(threadName), "SDLXInputDev%d", (int)userid);
haptic->hwdata->thread = SDL_CreateThreadInternal(SDL_RunXInputHaptic, threadName, 64 * 1024, haptic->hwdata);
if (haptic->hwdata->thread == NULL) {
SDL_DestroyMutex(haptic->hwdata->mutex);
SDL_free(haptic->effects);
SDL_free(haptic->hwdata);
haptic->effects = NULL;
return SDL_SetError("Couldn't create XInput haptic thread");
}
return 0;
}
int
SDL_XINPUT_HapticOpen(SDL_Haptic * haptic, SDL_hapticlist_item *item)
{
return SDL_XINPUT_HapticOpenFromUserIndex(haptic, item->userid);
}
int
SDL_XINPUT_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick)
{
return (haptic->hwdata->userid == joystick->hwdata->userid);
}
int
SDL_XINPUT_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick)
{
SDL_hapticlist_item *item;
int index = 0;
/* Since it comes from a joystick we have to try to match it with a haptic device on our haptic list. */
for (item = SDL_hapticlist; item != NULL; item = item->next) {
if (item->bXInputHaptic && item->userid == joystick->hwdata->userid) {
haptic->index = index;
return SDL_XINPUT_HapticOpenFromUserIndex(haptic, joystick->hwdata->userid);
}
++index;
}
SDL_SetError("Couldn't find joystick in haptic device list");
return -1;
}
void
SDL_XINPUT_HapticClose(SDL_Haptic * haptic)
{
SDL_AtomicSet(&haptic->hwdata->stopThread, 1);
SDL_WaitThread(haptic->hwdata->thread, NULL);
SDL_DestroyMutex(haptic->hwdata->mutex);
}
void
SDL_XINPUT_HapticQuit(void)
{
if (loaded_xinput) {
WIN_UnloadXInputDLL();
loaded_xinput = SDL_FALSE;
}
}
int
SDL_XINPUT_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SDL_HapticEffect * base)
{
SDL_assert(base->type == SDL_HAPTIC_LEFTRIGHT); /* should catch this at higher level */
return SDL_XINPUT_HapticUpdateEffect(haptic, effect, base);
}
int
SDL_XINPUT_HapticUpdateEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SDL_HapticEffect * data)
{
XINPUT_VIBRATION *vib = &effect->hweffect->vibration;
SDL_assert(data->type == SDL_HAPTIC_LEFTRIGHT);
/* SDL_HapticEffect has max magnitude of 32767, XInput expects 65535 max, so multiply */
vib->wLeftMotorSpeed = data->leftright.large_magnitude * 2;
vib->wRightMotorSpeed = data->leftright.small_magnitude * 2;
SDL_LockMutex(haptic->hwdata->mutex);
if (haptic->hwdata->stopTicks) { /* running right now? Update it. */
XINPUTSETSTATE(haptic->hwdata->userid, vib);
}
SDL_UnlockMutex(haptic->hwdata->mutex);
return 0;
}
int
SDL_XINPUT_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, Uint32 iterations)
{
XINPUT_VIBRATION *vib = &effect->hweffect->vibration;
SDL_assert(effect->effect.type == SDL_HAPTIC_LEFTRIGHT); /* should catch this at higher level */
SDL_LockMutex(haptic->hwdata->mutex);
if (effect->effect.leftright.length == SDL_HAPTIC_INFINITY || iterations == SDL_HAPTIC_INFINITY) {
haptic->hwdata->stopTicks = SDL_HAPTIC_INFINITY;
} else if ((!effect->effect.leftright.length) || (!iterations)) {
/* do nothing. Effect runs for zero milliseconds. */
} else {
haptic->hwdata->stopTicks = SDL_GetTicks() + (effect->effect.leftright.length * iterations);
if ((haptic->hwdata->stopTicks == SDL_HAPTIC_INFINITY) || (haptic->hwdata->stopTicks == 0)) {
haptic->hwdata->stopTicks = 1; /* fix edge cases. */
}
}
SDL_UnlockMutex(haptic->hwdata->mutex);
return (XINPUTSETSTATE(haptic->hwdata->userid, vib) == ERROR_SUCCESS) ? 0 : -1;
}
int
SDL_XINPUT_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect)
{
XINPUT_VIBRATION vibration = { 0, 0 };
SDL_LockMutex(haptic->hwdata->mutex);
haptic->hwdata->stopTicks = 0;
SDL_UnlockMutex(haptic->hwdata->mutex);
return (XINPUTSETSTATE(haptic->hwdata->userid, &vibration) == ERROR_SUCCESS) ? 0 : -1;
}
void
SDL_XINPUT_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect)
{
SDL_XINPUT_HapticStopEffect(haptic, effect);
}
int
SDL_XINPUT_HapticGetEffectStatus(SDL_Haptic * haptic, struct haptic_effect *effect)
{
return SDL_Unsupported();
}
int
SDL_XINPUT_HapticSetGain(SDL_Haptic * haptic, int gain)
{
return SDL_Unsupported();
}
int
SDL_XINPUT_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter)
{
return SDL_Unsupported();
}
int
SDL_XINPUT_HapticPause(SDL_Haptic * haptic)
{
return SDL_Unsupported();
}
int
SDL_XINPUT_HapticUnpause(SDL_Haptic * haptic)
{
return SDL_Unsupported();
}
int
SDL_XINPUT_HapticStopAll(SDL_Haptic * haptic)
{
XINPUT_VIBRATION vibration = { 0, 0 };
SDL_LockMutex(haptic->hwdata->mutex);
haptic->hwdata->stopTicks = 0;
SDL_UnlockMutex(haptic->hwdata->mutex);
return (XINPUTSETSTATE(haptic->hwdata->userid, &vibration) == ERROR_SUCCESS) ? 0 : -1;
}
#else /* !SDL_HAPTIC_XINPUT */
#include "../../core/windows/SDL_windows.h"
typedef struct SDL_hapticlist_item SDL_hapticlist_item;
int
SDL_XINPUT_HapticInit(void)
{
return 0;
}
int
SDL_XINPUT_MaybeAddDevice(const DWORD dwUserid)
{
return SDL_Unsupported();
}
int
SDL_XINPUT_MaybeRemoveDevice(const DWORD dwUserid)
{
return SDL_Unsupported();
}
int
SDL_XINPUT_HapticOpen(SDL_Haptic * haptic, SDL_hapticlist_item *item)
{
return SDL_Unsupported();
}
int
SDL_XINPUT_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick)
{
return SDL_Unsupported();
}
int
SDL_XINPUT_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick)
{
return SDL_Unsupported();
}
void
SDL_XINPUT_HapticClose(SDL_Haptic * haptic)
{
}
void
SDL_XINPUT_HapticQuit(void)
{
}
int
SDL_XINPUT_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SDL_HapticEffect * base)
{
return SDL_Unsupported();
}
int
SDL_XINPUT_HapticUpdateEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SDL_HapticEffect * data)
{
return SDL_Unsupported();
}
int
SDL_XINPUT_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, Uint32 iterations)
{
return SDL_Unsupported();
}
int
SDL_XINPUT_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect)
{
return SDL_Unsupported();
}
void
SDL_XINPUT_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect)
{
}
int
SDL_XINPUT_HapticGetEffectStatus(SDL_Haptic * haptic, struct haptic_effect *effect)
{
return SDL_Unsupported();
}
int
SDL_XINPUT_HapticSetGain(SDL_Haptic * haptic, int gain)
{
return SDL_Unsupported();
}
int
SDL_XINPUT_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter)
{
return SDL_Unsupported();
}
int
SDL_XINPUT_HapticPause(SDL_Haptic * haptic)
{
return SDL_Unsupported();
}
int
SDL_XINPUT_HapticUnpause(SDL_Haptic * haptic)
{
return SDL_Unsupported();
}
int
SDL_XINPUT_HapticStopAll(SDL_Haptic * haptic)
{
return SDL_Unsupported();
}
#endif /* SDL_HAPTIC_XINPUT */
/* vi: set ts=4 sw=4 expandtab: */
SDL_zero
#define SDL_zero(x)
Definition: SDL_stdinc.h:416
SDL_HAPTIC_LEFTRIGHT
#define SDL_HAPTIC_LEFTRIGHT
Left/Right effect supported.
Definition: SDL_haptic.h:183
SDL_XINPUT_HapticInit
int SDL_XINPUT_HapticInit(void)
Definition: SDL_xinputhaptic.c:375
haptic_hwdata::stopThread
SDL_atomic_t stopThread
Definition: SDL_windowshaptic_c.h:46
haptic_hwdata::userid
Uint8 userid
Definition: SDL_windowshaptic_c.h:42
SDL_memset
#define SDL_memset
Definition: SDL_dynapi_overrides.h:386
Uint32
uint32_t Uint32
Definition: SDL_stdinc.h:203
SDL_XINPUT_HapticGetEffectStatus
int SDL_XINPUT_HapticGetEffectStatus(SDL_Haptic *haptic, struct haptic_effect *effect)
Definition: SDL_xinputhaptic.c:450
SDL_XINPUT_HapticUnpause
int SDL_XINPUT_HapticUnpause(SDL_Haptic *haptic)
Definition: SDL_xinputhaptic.c:474
SDL_XINPUT_HapticDestroyEffect
void SDL_XINPUT_HapticDestroyEffect(SDL_Haptic *haptic, struct haptic_effect *effect)
Definition: SDL_xinputhaptic.c:445
SDL_XINPUT_HapticRunEffect
int SDL_XINPUT_HapticRunEffect(SDL_Haptic *haptic, struct haptic_effect *effect, Uint32 iterations)
Definition: SDL_xinputhaptic.c:433
SDL_LockMutex
#define SDL_LockMutex
Definition: SDL_dynapi_overrides.h:260
NULL
#define NULL
Definition: begin_code.h:167
SDL_XINPUT_HapticPause
int SDL_XINPUT_HapticPause(SDL_Haptic *haptic)
Definition: SDL_xinputhaptic.c:468
SDL_timer.h
SDL_XINPUT_HapticStopAll
int SDL_XINPUT_HapticStopAll(SDL_Haptic *haptic)
Definition: SDL_xinputhaptic.c:480
SDL_error.h
SDL_zerop
#define SDL_zerop(x)
Definition: SDL_stdinc.h:417
SDL_XINPUT_HapticQuit
void SDL_XINPUT_HapticQuit(void)
Definition: SDL_xinputhaptic.c:416
SDL_hapticlist_item
Definition: SDL_windowshaptic_c.h:67
iterations
static int iterations
Definition: testsprite2.c:45
SDLCALL
#define SDLCALL
Definition: SDL_internal.h:49
SDL_CreateMutex
#define SDL_CreateMutex
Definition: SDL_dynapi_overrides.h:259
SDL_XINPUT_HapticSetGain
int SDL_XINPUT_HapticSetGain(SDL_Haptic *haptic, int gain)
Definition: SDL_xinputhaptic.c:456
SDL_HapticEffect::leftright
SDL_HapticLeftRight leftright
Definition: SDL_haptic.h:808
haptic_hwdata::mutex
SDL_mutex * mutex
Definition: SDL_windowshaptic_c.h:44
index
GLuint index
Definition: SDL_opengl_glext.h:660
haptic_hwdata::stopTicks
Uint32 stopTicks
Definition: SDL_windowshaptic_c.h:45
haptic_effect::effect
SDL_HapticEffect effect
Definition: SDL_syshaptic.h:32
SDL_HAPTIC_INFINITY
#define SDL_HAPTIC_INFINITY
Used to play a device an infinite number of times.
Definition: SDL_haptic.h:352
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1974
haptic_hwdata
Definition: SDL_windowshaptic_c.h:34
SDL_XINPUT_HapticOpenFromJoystick
int SDL_XINPUT_HapticOpenFromJoystick(SDL_Haptic *haptic, SDL_Joystick *joystick)
Definition: SDL_xinputhaptic.c:405
SDL_HapticLeftRight::length
Uint32 length
Definition: SDL_haptic.h:682
SDL_haptic.h
The SDL haptic subsystem allows you to control haptic (force feedback) devices.
buf
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: SDL_opengl_glext.h:2480
SDL_GetHintBoolean
#define SDL_GetHintBoolean
Definition: SDL_dynapi_overrides.h:608
SDL_FALSE
@ SDL_FALSE
Definition: SDL_stdinc.h:163
SDL_XINPUT_HapticSetAutocenter
int SDL_XINPUT_HapticSetAutocenter(SDL_Haptic *haptic, int autocenter)
Definition: SDL_xinputhaptic.c:462
SDL_HINT_XINPUT_ENABLED
#define SDL_HINT_XINPUT_ENABLED
A variable that lets you disable the detection and use of Xinput gamepad devices.
Definition: SDL_hints.h:428
SDL_SYS_AddHapticDevice
int SDL_SYS_AddHapticDevice(SDL_hapticlist_item *item)
SDL_XINPUT_HapticClose
void SDL_XINPUT_HapticClose(SDL_Haptic *haptic)
Definition: SDL_xinputhaptic.c:411
SDL_CreateThreadInternal
SDL_Thread * SDL_CreateThreadInternal(int(*fn)(void *), const char *name, const size_t stacksize, void *data)
Definition: SDL_thread.c:429
SDL_xinputhaptic_c.h
SDL_free
#define SDL_free
Definition: SDL_dynapi_overrides.h:377
SDL_HapticEffect
The generic template for any haptic effect.
Definition: SDL_haptic.h:800
SDL_XINPUT_HapticOpen
int SDL_XINPUT_HapticOpen(SDL_Haptic *haptic, SDL_hapticlist_item *item)
Definition: SDL_xinputhaptic.c:393
SDL_assert.h
SDL_GetTicks
Uint32 SDL_GetTicks(void)
Get the number of milliseconds since the SDL library initialization.
haptic_effect
Definition: SDL_syshaptic.h:30
SDL_XINPUT_JoystickSameHaptic
int SDL_XINPUT_JoystickSameHaptic(SDL_Haptic *haptic, SDL_Joystick *joystick)
Definition: SDL_xinputhaptic.c:399
SDL_Delay
#define SDL_Delay
Definition: SDL_dynapi_overrides.h:486
SDL_assert
#define SDL_assert(condition)
Definition: SDL_assert.h:169
SDL_hapticlist_item::userid
Uint8 userid
Definition: SDL_windowshaptic_c.h:76
SDL_OutOfMemory
#define SDL_OutOfMemory()
Definition: SDL_error.h:52
SDL_hapticlist_item::next
struct SDL_hapticlist_item * next
Definition: SDL_windowshaptic_c.h:77
SDL_XINPUT_HapticStopEffect
int SDL_XINPUT_HapticStopEffect(SDL_Haptic *haptic, struct haptic_effect *effect)
Definition: SDL_xinputhaptic.c:439
haptic
static SDL_Haptic * haptic
Definition: testhaptic.c:25
SDL_TRUE
@ SDL_TRUE
Definition: SDL_stdinc.h:164
SDL_windowshaptic_c.h
SDL_SetError
#define SDL_SetError
Definition: SDL_dynapi_overrides.h:30
SDL_snprintf
#define SDL_snprintf
Definition: SDL_dynapi_overrides.h:40
SDL_hints.h
SDL_hapticlist_item::name
char * name
Definition: SDL_windowshaptic_c.h:69
SDL_DestroyMutex
#define SDL_DestroyMutex
Definition: SDL_dynapi_overrides.h:263
SDL_SYS_RemoveHapticDevice
int SDL_SYS_RemoveHapticDevice(SDL_hapticlist_item *prev, SDL_hapticlist_item *item)
SDL_strdup
#define SDL_strdup
Definition: SDL_dynapi_overrides.h:397
SDL_TICKS_PASSED
#define SDL_TICKS_PASSED(A, B)
Compare SDL ticks values, and return true if A has passed B.
Definition: SDL_timer.h:56
SDL_hapticlist
SDL_hapticlist_item * SDL_hapticlist
haptic_effect::hweffect
struct haptic_hweffect * hweffect
Definition: SDL_syshaptic.h:33
SDL_Unsupported
#define SDL_Unsupported()
Definition: SDL_error.h:53
SDL_AtomicSet
#define SDL_AtomicSet
Definition: SDL_dynapi_overrides.h:67
SDL_malloc
#define SDL_malloc
Definition: SDL_dynapi_overrides.h:374
SDL_AtomicGet
#define SDL_AtomicGet
Definition: SDL_dynapi_overrides.h:68
SDL_XINPUT_MaybeRemoveDevice
int SDL_XINPUT_MaybeRemoveDevice(const DWORD dwUserid)
Definition: SDL_xinputhaptic.c:387
SDL_UnlockMutex
#define SDL_UnlockMutex
Definition: SDL_dynapi_overrides.h:262
SDL_XINPUT_HapticUpdateEffect
int SDL_XINPUT_HapticUpdateEffect(SDL_Haptic *haptic, struct haptic_effect *effect, SDL_HapticEffect *data)
Definition: SDL_xinputhaptic.c:427
SDL_XINPUT_MaybeAddDevice
int SDL_XINPUT_MaybeAddDevice(const DWORD dwUserid)
Definition: SDL_xinputhaptic.c:381
SDL_XINPUT_HapticNewEffect
int SDL_XINPUT_HapticNewEffect(SDL_Haptic *haptic, struct haptic_effect *effect, SDL_HapticEffect *base)
Definition: SDL_xinputhaptic.c:421
state
struct xkb_state * state
Definition: SDL_waylandsym.h:113
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:50
SDL_WaitThread
#define SDL_WaitThread
Definition: SDL_dynapi_overrides.h:478
SDL_hapticlist_item::bXInputHaptic
SDL_bool bXInputHaptic
Definition: SDL_windowshaptic_c.h:75
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:161
SDL_HapticEffect::type
Uint16 type
Definition: SDL_haptic.h:803
Uint8
uint8_t Uint8
Definition: SDL_stdinc.h:179