21#include "../../SDL_internal.h"
23#ifdef SDL_HAPTIC_ANDROID
27#include "SDL_syshaptic_c.h"
28#include "../SDL_syshaptic.h"
30#include "../../core/android/SDL_android.h"
32#include "../../joystick/SDL_sysjoystick.h"
33#include "../../joystick/android/SDL_sysjoystick_c.h"
46static int numhaptics = 0;
71HapticByOrder(
int index)
86HapticByDevId (
int device_id)
90 if (device_id == item->device_id) {
144OpenHapticByDevId(SDL_Haptic *
haptic,
int device_id)
146 return OpenHaptic (
haptic, HapticByDevId(device_id));
167 item = HapticByDevId(((
joystick_hwdata *)joystick->hwdata)->device_id);
168 return (item !=
NULL) ? 1 : 0;
241 float total = (large * 0.6f) + (small * 0.4f);
305Android_AddHaptic(
int device_id,
const char *
name)
313 item->device_id = device_id;
320 if (SDL_hapticlist_tail ==
NULL) {
323 SDL_hapticlist_tail->
next = item;
324 SDL_hapticlist_tail = item;
332Android_RemoveHaptic(
int device_id)
339 if (device_id == item->device_id) {
348 if (item == SDL_hapticlist_tail) {
349 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)
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)
const char * SDL_SYS_HapticName(int index)
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
struct SDL_hapticlist_item * next
static SDL_Haptic * haptic
The generic template for any haptic effect.
SDL_HapticLeftRight leftright