SDL_windowshaptic.c
Go to the documentation of this file.
/*
Simple DirectMedia Layer
Copyright (C) 1997-2016 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"
#if SDL_HAPTIC_DINPUT || SDL_HAPTIC_XINPUT
#include "SDL_assert.h"
#include "SDL_thread.h"
#include "SDL_mutex.h"
#include "SDL_timer.h"
#include "SDL_hints.h"
#include "SDL_haptic.h"
#include "../SDL_syshaptic.h"
#include "SDL_joystick.h"
#include "../../joystick/SDL_sysjoystick.h" /* For the real SDL_Joystick */
#include "../../joystick/windows/SDL_windowsjoystick_c.h" /* For joystick hwdata */
#include "../../joystick/windows/SDL_xinputjoystick_c.h" /* For xinput rumble */
#include "SDL_windowshaptic_c.h"
#include "SDL_dinputhaptic_c.h"
#include "SDL_xinputhaptic_c.h"
/*
* Internal stuff.
*/
SDL_hapticlist_item *SDL_hapticlist = NULL;
static SDL_hapticlist_item *SDL_hapticlist_tail = NULL;
static int numhaptics = 0;
/*
* Initializes the haptic subsystem.
*/
int
SDL_SYS_HapticInit(void)
{
if (SDL_DINPUT_HapticInit() < 0) {
return -1;
}
if (SDL_XINPUT_HapticInit() < 0) {
return -1;
}
return numhaptics;
}
int
SDL_SYS_AddHapticDevice(SDL_hapticlist_item *item)
{
if (SDL_hapticlist_tail == NULL) {
SDL_hapticlist = SDL_hapticlist_tail = item;
} else {
SDL_hapticlist_tail->next = item;
SDL_hapticlist_tail = item;
}
/* Device has been added. */
++numhaptics;
return numhaptics;
}
int
SDL_SYS_RemoveHapticDevice(SDL_hapticlist_item *prev, SDL_hapticlist_item *item)
{
const int retval = item->haptic ? item->haptic->index : -1;
if (prev != NULL) {
prev->next = item->next;
} else {
SDL_assert(SDL_hapticlist == item);
SDL_hapticlist = item->next;
}
if (item == SDL_hapticlist_tail) {
SDL_hapticlist_tail = prev;
}
--numhaptics;
/* !!! TODO: Send a haptic remove event? */
SDL_free(item);
return retval;
}
int
SDL_SYS_NumHaptics()
{
return numhaptics;
}
static SDL_hapticlist_item *
HapticByDevIndex(int device_index)
{
SDL_hapticlist_item *item = SDL_hapticlist;
if ((device_index < 0) || (device_index >= numhaptics)) {
return NULL;
}
while (device_index > 0) {
SDL_assert(item != NULL);
--device_index;
item = item->next;
}
return item;
}
/*
* Return the name of a haptic device, does not need to be opened.
*/
const char *
SDL_SYS_HapticName(int index)
{
SDL_hapticlist_item *item = HapticByDevIndex(index);
return item->name;
}
/*
* Opens a haptic device for usage.
*/
int
SDL_SYS_HapticOpen(SDL_Haptic * haptic)
{
SDL_hapticlist_item *item = HapticByDevIndex(haptic->index);
if (item->bXInputHaptic) {
return SDL_XINPUT_HapticOpen(haptic, item);
} else {
return SDL_DINPUT_HapticOpen(haptic, item);
}
}
/*
* Opens a haptic device from first mouse it finds for usage.
*/
int
SDL_SYS_HapticMouse(void)
{
#if SDL_HAPTIC_DINPUT
SDL_hapticlist_item *item;
int index = 0;
/* Grab the first mouse haptic device we find. */
for (item = SDL_hapticlist; item != NULL; item = item->next) {
if (item->capabilities.dwDevType == DI8DEVCLASS_POINTER ) {
return index;
}
++index;
}
#endif /* SDL_HAPTIC_DINPUT */
return -1;
}
/*
* Checks to see if a joystick has haptic features.
*/
int
SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick)
{
const struct joystick_hwdata *hwdata = joystick->hwdata;
#if SDL_HAPTIC_XINPUT
if (hwdata->bXInputHaptic) {
return 1;
}
#endif
#if SDL_HAPTIC_DINPUT
if (hwdata->Capabilities.dwFlags & DIDC_FORCEFEEDBACK) {
return 1;
}
#endif
return 0;
}
/*
* Checks to see if the haptic device and joystick are in reality the same.
*/
int
SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick)
{
if (joystick->hwdata->bXInputHaptic != haptic->hwdata->bXInputHaptic) {
return 0; /* one is XInput, one is not; not the same device. */
} else if (joystick->hwdata->bXInputHaptic) {
return SDL_XINPUT_JoystickSameHaptic(haptic, joystick);
} else {
return SDL_DINPUT_JoystickSameHaptic(haptic, joystick);
}
}
/*
* Opens a SDL_Haptic from a SDL_Joystick.
*/
int
SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick)
{
if (joystick->hwdata->bXInputDevice) {
return SDL_XINPUT_HapticOpenFromJoystick(haptic, joystick);
} else {
return SDL_DINPUT_HapticOpenFromJoystick(haptic, joystick);
}
}
/*
* Closes the haptic device.
*/
void
SDL_SYS_HapticClose(SDL_Haptic * haptic)
{
if (haptic->hwdata) {
/* Free effects. */
SDL_free(haptic->effects);
haptic->effects = NULL;
haptic->neffects = 0;
/* Clean up */
if (haptic->hwdata->bXInputHaptic) {
SDL_XINPUT_HapticClose(haptic);
} else {
SDL_DINPUT_HapticClose(haptic);
}
/* Free */
SDL_free(haptic->hwdata);
haptic->hwdata = NULL;
}
}
/*
* Clean up after system specific haptic stuff
*/
void
SDL_SYS_HapticQuit(void)
{
SDL_hapticlist_item *item;
SDL_hapticlist_item *next = NULL;
SDL_Haptic *hapticitem = NULL;
extern SDL_Haptic *SDL_haptics;
for (hapticitem = SDL_haptics; hapticitem; hapticitem = hapticitem->next) {
if ((hapticitem->hwdata->bXInputHaptic) && (hapticitem->hwdata->thread)) {
/* we _have_ to stop the thread before we free the XInput DLL! */
hapticitem->hwdata->stopThread = 1;
SDL_WaitThread(hapticitem->hwdata->thread, NULL);
hapticitem->hwdata->thread = NULL;
}
}
for (item = SDL_hapticlist; item; item = next) {
/* Opened and not closed haptics are leaked, this is on purpose.
* Close your haptic devices after usage. */
/* !!! FIXME: (...is leaking on purpose a good idea?) - No, of course not. */
next = item->next;
SDL_free(item->name);
SDL_free(item);
}
SDL_XINPUT_HapticQuit();
SDL_DINPUT_HapticQuit();
numhaptics = 0;
SDL_hapticlist = NULL;
SDL_hapticlist_tail = NULL;
}
/*
* Creates a new haptic effect.
*/
int
SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect,
SDL_HapticEffect * base)
{
int result;
/* Alloc the effect. */
effect->hweffect = (struct haptic_hweffect *)
SDL_malloc(sizeof(struct haptic_hweffect));
if (effect->hweffect == NULL) {
SDL_OutOfMemory();
return -1;
}
SDL_zerop(effect->hweffect);
if (haptic->hwdata->bXInputHaptic) {
result = SDL_XINPUT_HapticNewEffect(haptic, effect, base);
} else {
result = SDL_DINPUT_HapticNewEffect(haptic, effect, base);
}
if (result < 0) {
SDL_free(effect->hweffect);
effect->hweffect = NULL;
}
return result;
}
/*
* Updates an effect.
*/
int
SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic,
struct haptic_effect *effect,
SDL_HapticEffect * data)
{
if (haptic->hwdata->bXInputHaptic) {
return SDL_XINPUT_HapticUpdateEffect(haptic, effect, data);
} else {
return SDL_DINPUT_HapticUpdateEffect(haptic, effect, data);
}
}
/*
* Runs an effect.
*/
int
SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect,
Uint32 iterations)
{
if (haptic->hwdata->bXInputHaptic) {
return SDL_XINPUT_HapticRunEffect(haptic, effect, iterations);
} else {
return SDL_DINPUT_HapticRunEffect(haptic, effect, iterations);
}
}
/*
* Stops an effect.
*/
int
SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect)
{
if (haptic->hwdata->bXInputHaptic) {
return SDL_XINPUT_HapticStopEffect(haptic, effect);
} else {
return SDL_DINPUT_HapticStopEffect(haptic, effect);
}
}
/*
* Frees the effect.
*/
void
SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect)
{
if (haptic->hwdata->bXInputHaptic) {
SDL_XINPUT_HapticDestroyEffect(haptic, effect);
} else {
SDL_DINPUT_HapticDestroyEffect(haptic, effect);
}
SDL_free(effect->hweffect);
effect->hweffect = NULL;
}
/*
* Gets the status of a haptic effect.
*/
int
SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic,
struct haptic_effect *effect)
{
if (haptic->hwdata->bXInputHaptic) {
return SDL_XINPUT_HapticGetEffectStatus(haptic, effect);
} else {
return SDL_DINPUT_HapticGetEffectStatus(haptic, effect);
}
}
/*
* Sets the gain.
*/
int
SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain)
{
if (haptic->hwdata->bXInputHaptic) {
return SDL_XINPUT_HapticSetGain(haptic, gain);
} else {
return SDL_DINPUT_HapticSetGain(haptic, gain);
}
}
/*
* Sets the autocentering.
*/
int
SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter)
{
if (haptic->hwdata->bXInputHaptic) {
return SDL_XINPUT_HapticSetAutocenter(haptic, autocenter);
} else {
return SDL_DINPUT_HapticSetAutocenter(haptic, autocenter);
}
}
/*
* Pauses the device.
*/
int
SDL_SYS_HapticPause(SDL_Haptic * haptic)
{
if (haptic->hwdata->bXInputHaptic) {
return SDL_XINPUT_HapticPause(haptic);
} else {
return SDL_DINPUT_HapticPause(haptic);
}
}
/*
* Pauses the device.
*/
int
SDL_SYS_HapticUnpause(SDL_Haptic * haptic)
{
if (haptic->hwdata->bXInputHaptic) {
return SDL_XINPUT_HapticUnpause(haptic);
} else {
return SDL_DINPUT_HapticUnpause(haptic);
}
}
/*
* Stops all the playing effects on the device.
*/
int
SDL_SYS_HapticStopAll(SDL_Haptic * haptic)
{
if (haptic->hwdata->bXInputHaptic) {
return SDL_XINPUT_HapticStopAll(haptic);
} else {
return SDL_DINPUT_HapticStopAll(haptic);
}
}
#endif /* SDL_HAPTIC_DINPUT || SDL_HAPTIC_XINPUT */
/* vi: set ts=4 sw=4 expandtab: */
SDL_XINPUT_HapticInit
int SDL_XINPUT_HapticInit(void)
Definition: SDL_xinputhaptic.c:383
SDL_SYS_HapticOpenFromJoystick
int SDL_SYS_HapticOpenFromJoystick(SDL_Haptic *haptic, SDL_Joystick *joystick)
SDL_XINPUT_HapticSetGain
int SDL_XINPUT_HapticSetGain(SDL_Haptic *haptic, int gain)
Definition: SDL_xinputhaptic.c:464
haptic_hweffect
Definition: SDL_windowshaptic_c.h:53
SDL_XINPUT_HapticUnpause
int SDL_XINPUT_HapticUnpause(SDL_Haptic *haptic)
Definition: SDL_xinputhaptic.c:482
SDL_DINPUT_HapticQuit
void SDL_DINPUT_HapticQuit(void)
Definition: SDL_dinputhaptic.c:1229
SDL_DINPUT_HapticUpdateEffect
int SDL_DINPUT_HapticUpdateEffect(SDL_Haptic *haptic, struct haptic_effect *effect, SDL_HapticEffect *data)
Definition: SDL_dinputhaptic.c:1240
SDL_joystick.h
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9432
SDL_DINPUT_HapticSetAutocenter
int SDL_DINPUT_HapticSetAutocenter(SDL_Haptic *haptic, int autocenter)
Definition: SDL_dinputhaptic.c:1275
SDL_hapticlist_item::name
char * name
Definition: SDL_windowshaptic_c.h:69
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:157
SDL_XINPUT_HapticGetEffectStatus
int SDL_XINPUT_HapticGetEffectStatus(SDL_Haptic *haptic, struct haptic_effect *effect)
Definition: SDL_xinputhaptic.c:458
SDL_SYS_HapticOpen
int SDL_SYS_HapticOpen(SDL_Haptic *haptic)
SDL_SYS_HapticMouse
int SDL_SYS_HapticMouse(void)
SDL_SYS_JoystickSameHaptic
int SDL_SYS_JoystickSameHaptic(SDL_Haptic *haptic, SDL_Joystick *joystick)
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1967
SDL_DINPUT_HapticSetGain
int SDL_DINPUT_HapticSetGain(SDL_Haptic *haptic, int gain)
Definition: SDL_dinputhaptic.c:1269
SDL_SYS_HapticStopEffect
int SDL_SYS_HapticStopEffect(SDL_Haptic *haptic, struct haptic_effect *effect)
SDL_hapticlist_item::haptic
SDL_Haptic * haptic
Definition: SDL_windowshaptic_c.h:70
SDL_SYS_HapticName
const char * SDL_SYS_HapticName(int index)
SDL_XINPUT_HapticOpenFromJoystick
int SDL_XINPUT_HapticOpenFromJoystick(SDL_Haptic *haptic, SDL_Joystick *joystick)
Definition: SDL_xinputhaptic.c:413
SDL_mutex.h
joystick_hwdata::next
struct joystick_hwdata * next
Definition: SDL_sysjoystick_c.h:47
SDL_haptic.h
The SDL Haptic subsystem allows you to control haptic (force feedback) devices.
SDL_SYS_HapticUnpause
int SDL_SYS_HapticUnpause(SDL_Haptic *haptic)
SDL_XINPUT_HapticStopEffect
int SDL_XINPUT_HapticStopEffect(SDL_Haptic *haptic, struct haptic_effect *effect)
Definition: SDL_xinputhaptic.c:447
iterations
static int iterations
Definition: testsprite2.c:43
SDL_DINPUT_HapticRunEffect
int SDL_DINPUT_HapticRunEffect(SDL_Haptic *haptic, struct haptic_effect *effect, Uint32 iterations)
Definition: SDL_dinputhaptic.c:1246
SDL_DINPUT_HapticDestroyEffect
void SDL_DINPUT_HapticDestroyEffect(SDL_Haptic *haptic, struct haptic_effect *effect)
Definition: SDL_dinputhaptic.c:1258
SDL_SYS_NumHaptics
int SDL_SYS_NumHaptics()
SDL_zerop
#define SDL_zerop(x)
Definition: SDL_stdinc.h:358
SDL_DINPUT_HapticInit
int SDL_DINPUT_HapticInit(void)
Definition: SDL_dinputhaptic.c:1188
SDL_SYS_HapticGetEffectStatus
int SDL_SYS_HapticGetEffectStatus(SDL_Haptic *haptic, struct haptic_effect *effect)
SDL_DINPUT_HapticGetEffectStatus
int SDL_DINPUT_HapticGetEffectStatus(SDL_Haptic *haptic, struct haptic_effect *effect)
Definition: SDL_dinputhaptic.c:1263
SDL_thread.h
SDL_DINPUT_HapticOpen
int SDL_DINPUT_HapticOpen(SDL_Haptic *haptic, SDL_hapticlist_item *item)
Definition: SDL_dinputhaptic.c:1206
SDL_SYS_RemoveHapticDevice
int SDL_SYS_RemoveHapticDevice(SDL_hapticlist_item *prev, SDL_hapticlist_item *item)
joystick_hwdata
Definition: SDL_sysjoystick_c.h:44
SDL_hapticlist
SDL_hapticlist_item * SDL_hapticlist
SDL_hapticlist_item::next
struct SDL_hapticlist_item * next
Definition: SDL_windowshaptic_c.h:77
retval
SDL_bool retval
Definition: testgamecontroller.c:65
SDL_HapticEffect
The generic template for any haptic effect.
Definition: SDL_haptic.h:785
SDL_SYS_HapticSetAutocenter
int SDL_SYS_HapticSetAutocenter(SDL_Haptic *haptic, int autocenter)
SDL_DINPUT_HapticNewEffect
int SDL_DINPUT_HapticNewEffect(SDL_Haptic *haptic, struct haptic_effect *effect, SDL_HapticEffect *base)
Definition: SDL_dinputhaptic.c:1234
SDL_XINPUT_HapticNewEffect
int SDL_XINPUT_HapticNewEffect(SDL_Haptic *haptic, struct haptic_effect *effect, SDL_HapticEffect *base)
Definition: SDL_xinputhaptic.c:429
SDL_xinputhaptic_c.h
SDL_free
void SDL_free(void *mem)
SDL_XINPUT_HapticRunEffect
int SDL_XINPUT_HapticRunEffect(SDL_Haptic *haptic, struct haptic_effect *effect, Uint32 iterations)
Definition: SDL_xinputhaptic.c:441
haptic_effect
Definition: SDL_syshaptic.h:30
SDL_dinputhaptic_c.h
SDL_hints.h
SDL_XINPUT_HapticSetAutocenter
int SDL_XINPUT_HapticSetAutocenter(SDL_Haptic *haptic, int autocenter)
Definition: SDL_xinputhaptic.c:470
SDL_SYS_HapticUpdateEffect
int SDL_SYS_HapticUpdateEffect(SDL_Haptic *haptic, struct haptic_effect *effect, SDL_HapticEffect *data)
SDL_SYS_JoystickIsHaptic
int SDL_SYS_JoystickIsHaptic(SDL_Joystick *joystick)
SDL_XINPUT_HapticClose
void SDL_XINPUT_HapticClose(SDL_Haptic *haptic)
Definition: SDL_xinputhaptic.c:419
SDL_DINPUT_HapticClose
void SDL_DINPUT_HapticClose(SDL_Haptic *haptic)
Definition: SDL_dinputhaptic.c:1224
SDL_DINPUT_JoystickSameHaptic
int SDL_DINPUT_JoystickSameHaptic(SDL_Haptic *haptic, SDL_Joystick *joystick)
Definition: SDL_dinputhaptic.c:1212
index
GLuint index
Definition: SDL_opengl_glext.h:660
SDL_SYS_HapticDestroyEffect
void SDL_SYS_HapticDestroyEffect(SDL_Haptic *haptic, struct haptic_effect *effect)
SDL_assert
#define SDL_assert(condition)
Definition: SDL_assert.h:167
SDL_XINPUT_HapticOpen
int SDL_XINPUT_HapticOpen(SDL_Haptic *haptic, SDL_hapticlist_item *item)
Definition: SDL_xinputhaptic.c:401
SDL_DINPUT_HapticUnpause
int SDL_DINPUT_HapticUnpause(SDL_Haptic *haptic)
Definition: SDL_dinputhaptic.c:1287
NULL
#define NULL
Definition: begin_code.h:143
SDL_OutOfMemory
#define SDL_OutOfMemory()
Definition: SDL_error.h:52
SDL_XINPUT_HapticQuit
void SDL_XINPUT_HapticQuit(void)
Definition: SDL_xinputhaptic.c:424
haptic
static SDL_Haptic * haptic
Definition: testhaptic.c:25
SDL_SYS_HapticInit
int SDL_SYS_HapticInit(void)
SDL_SYS_HapticQuit
void SDL_SYS_HapticQuit(void)
haptic_effect::hweffect
struct haptic_hweffect * hweffect
Definition: SDL_syshaptic.h:33
SDL_SYS_HapticClose
void SDL_SYS_HapticClose(SDL_Haptic *haptic)
SDL_SYS_HapticPause
int SDL_SYS_HapticPause(SDL_Haptic *haptic)
SDL_DINPUT_HapticOpenFromJoystick
int SDL_DINPUT_HapticOpenFromJoystick(SDL_Haptic *haptic, SDL_Joystick *joystick)
Definition: SDL_dinputhaptic.c:1218
joystick_hwdata::item
struct SDL_joylist_item * item
Definition: SDL_sysjoystick_c.h:30
SDL_DINPUT_HapticPause
int SDL_DINPUT_HapticPause(SDL_Haptic *haptic)
Definition: SDL_dinputhaptic.c:1281
SDL_XINPUT_HapticUpdateEffect
int SDL_XINPUT_HapticUpdateEffect(SDL_Haptic *haptic, struct haptic_effect *effect, SDL_HapticEffect *data)
Definition: SDL_xinputhaptic.c:435
SDL_hapticlist_item
Definition: SDL_windowshaptic_c.h:67
SDL_XINPUT_JoystickSameHaptic
int SDL_XINPUT_JoystickSameHaptic(SDL_Haptic *haptic, SDL_Joystick *joystick)
Definition: SDL_xinputhaptic.c:407
SDL_XINPUT_HapticStopAll
int SDL_XINPUT_HapticStopAll(SDL_Haptic *haptic)
Definition: SDL_xinputhaptic.c:488
SDL_SYS_HapticStopAll
int SDL_SYS_HapticStopAll(SDL_Haptic *haptic)
joystick_hwdata::bXInputHaptic
SDL_bool bXInputHaptic
Definition: SDL_windowsjoystick_c.h:81
SDL_malloc
#define SDL_malloc
Definition: SDL_dynapi_overrides.h:380
SDL_DINPUT_HapticStopAll
int SDL_DINPUT_HapticStopAll(SDL_Haptic *haptic)
Definition: SDL_dinputhaptic.c:1293
SDL_SYS_HapticSetGain
int SDL_SYS_HapticSetGain(SDL_Haptic *haptic, int gain)
SDL_DINPUT_HapticStopEffect
int SDL_DINPUT_HapticStopEffect(SDL_Haptic *haptic, struct haptic_effect *effect)
Definition: SDL_dinputhaptic.c:1252
SDL_windowshaptic_c.h
SDL_timer.h
SDL_SYS_HapticRunEffect
int SDL_SYS_HapticRunEffect(SDL_Haptic *haptic, struct haptic_effect *effect, Uint32 iterations)
SDL_XINPUT_HapticPause
int SDL_XINPUT_HapticPause(SDL_Haptic *haptic)
Definition: SDL_xinputhaptic.c:476
SDL_hapticlist_item::bXInputHaptic
SDL_bool bXInputHaptic
Definition: SDL_windowshaptic_c.h:75
SDL_XINPUT_HapticDestroyEffect
void SDL_XINPUT_HapticDestroyEffect(SDL_Haptic *haptic, struct haptic_effect *effect)
Definition: SDL_xinputhaptic.c:453
SDL_SYS_AddHapticDevice
int SDL_SYS_AddHapticDevice(SDL_hapticlist_item *item)
SDL_assert.h
SDL_WaitThread
#define SDL_WaitThread
Definition: SDL_dynapi_overrides.h:482
SDL_SYS_HapticNewEffect
int SDL_SYS_HapticNewEffect(SDL_Haptic *haptic, struct haptic_effect *effect, SDL_HapticEffect *base)
SDL_haptics
SDL_Haptic * SDL_haptics
Definition: SDL_haptic.c:28