23 #ifndef SDL_HAPTIC_DISABLED 41 main(
int argc,
char **argv)
49 unsigned int supported;
58 if ((strcmp(name,
"--help") == 0) || (strcmp(name,
"-h") == 0)) {
60 "If device is a two-digit number it'll use it as an index, otherwise\n" 61 "it'll use it as if it were part of the device's name.\n",
67 if ((i < 3) && isdigit(name[0]) && ((i == 1) || isdigit(name[1]))) {
80 i = (index != -1) ? index : 0;
113 memset(&efx, 0,
sizeof(efx));
117 SDL_Log(
"\nUploading effects\n");
120 SDL_Log(
" effect %d: Sine Wave\n", nefx);
137 SDL_Log(
" effect %d: Sawtooth Up\n", nefx);
154 SDL_Log(
" effect %d: Constant Force\n", nefx);
172 SDL_Log(
" effect %d: Condition Spring\n", nefx);
191 SDL_Log(
" effect %d: Condition Damper\n", nefx);
209 SDL_Log(
" effect %d: Condition Inertia\n", nefx);
228 SDL_Log(
" effect %d: Condition Friction\n", nefx);
247 SDL_Log(
" effect %d: Ramp\n", nefx);
267 SDL_Log(
" effect %d: Left/Right\n", nefx);
282 (
"\nNow playing effects for 5 seconds each with 1 second delay between\n");
283 for (i = 0; i < nefx; i++) {
284 SDL_Log(
" Playing effect %d\n", i);
304 SDL_Log(
"\nAborting program execution.\n");
319 unsigned int supported;
322 SDL_Log(
" Supported effects [%d effects, %d playing]:\n",
351 SDL_Log(
" Supported capabilities:\n");
363 main(
int argc,
char *argv[])
#define SDL_HapticNewEffect
#define SDL_HAPTIC_AUTOCENTER
Device can set autocenter.
#define SDL_INIT_JOYSTICK
#define SDL_HAPTIC_GAIN
Device can set global gain.
#define SDL_HAPTIC_CUSTOM
Custom effect is supported.
#define SDL_HAPTIC_TRIANGLE
Triangle wave effect supported.
static void HapticPrintSupported(SDL_Haptic *haptic)
#define SDL_HAPTIC_INERTIA
Inertia effect supported - uses axes acceleration.
int main(int argc, char **argv)
The entry point of this force feedback demo.
#define SDL_HAPTIC_SINE
Sine wave effect supported.
#define SDL_HapticRunEffect
GLuint const GLchar * name
#define SDL_HAPTIC_CARTESIAN
Uses cartesian coordinates for the direction.
SDL_HapticCondition condition
The generic template for any haptic effect.
#define SDL_HAPTIC_CONSTANT
Constant effect supported.
#define SDL_HAPTIC_POLAR
Uses polar coordinates for the direction.
SDL_HapticConstant constant
static void abort_execution(void)
SDL_HapticDirection direction
#define SDL_HapticNumAxes
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)
#define SDL_LogSetPriority
static SDL_Haptic * haptic
#define SDL_HAPTIC_STATUS
Device can be queried for effect status.
#define SDL_HapticNumEffectsPlaying
SDL_HapticLeftRight leftright
#define SDL_HAPTIC_RAMP
Ramp effect supported.
#define SDL_HAPTIC_SPRING
Spring effect supported - uses axes position.
#define SDL_HAPTIC_SAWTOOTHUP
Sawtoothup wave effect supported.
#define SDL_HapticNumEffects
#define SDL_HAPTIC_LEFTRIGHT
Left/Right effect supported.
SDL_HapticPeriodic periodic
#define SDL_HAPTIC_FRICTION
Friction effect supported - uses axes movement.
#define SDL_HAPTIC_SAWTOOTHDOWN
Sawtoothdown wave effect supported.
SDL_HapticDirection direction
#define SDL_HAPTIC_DAMPER
Damper effect supported - uses axes velocity.