21 #include "../../SDL_internal.h"
23 #ifdef SDL_HAPTIC_ANDROID
26 #include "SDL_syshaptic_c.h"
27 #include "../SDL_syshaptic.h"
29 #include "../../core/android/SDL_android.h"
31 #include "../../joystick/SDL_sysjoystick.h"
32 #include "../../joystick/android/SDL_sysjoystick_c.h"
45 static int numhaptics = 0;
70 HapticByOrder(
int index)
85 HapticByDevId (
int device_id)
89 if (device_id == item->device_id) {
143 OpenHapticByDevId(SDL_Haptic *
haptic,
int device_id)
145 return OpenHaptic (
haptic, HapticByDevId(device_id));
167 return (item !=
NULL) ? 1 : 0;
240 float total = (large * 0.6f) + (small * 0.4f);
304 Android_AddHaptic(
int device_id,
const char *
name)
312 item->device_id = device_id;
319 if (SDL_hapticlist_tail ==
NULL) {
322 SDL_hapticlist_tail->
next = item;
323 SDL_hapticlist_tail = item;
331 Android_RemoveHaptic(
int device_id)
338 if (device_id == item->device_id) {
347 if (item == SDL_hapticlist_tail) {
348 SDL_hapticlist_tail = prev;
void Android_JNI_HapticRun(int device_id, float intensity, int length)
void Android_JNI_PollHapticDevices(void)
void Android_JNI_HapticStop(int device_id)
#define SDL_assert(condition)
#define SDL_OutOfMemory()
The SDL haptic subsystem allows you to control haptic (force feedback) devices.
#define SDL_HAPTIC_LEFTRIGHT
Left/Right effect supported.
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLbitfield GLuint64 timeout
GLuint const GLchar * name
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)
Uint32 SDL_GetTicks(void)
Get the number of milliseconds since the SDL library initialization.
#define SDL_TICKS_PASSED(A, B)
Compare SDL ticks values, and return true if A has passed B.
SDL_hapticlist_item * SDL_hapticlist
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
static SDL_Haptic * haptic
static SDL_Joystick * joystick
The generic template for any haptic effect.
SDL_HapticLeftRight leftright