diff include/SDL_haptic.h @ 2486:24dd8b8669fa gsoc2008_force_feedback

Added SDL_HAPTIC_CUSTOM (not supported on linux). Exposed SDL_HapticEffectSupported().
author Edgar Simo <bobbens@gmail.com>
date Tue, 01 Jul 2008 16:19:54 +0000
parents 67978eea6d10
children 4c8e25ef2d97
line wrap: on
line diff
--- a/include/SDL_haptic.h	Tue Jul 01 14:31:04 2008 +0000
+++ b/include/SDL_haptic.h	Tue Jul 01 16:19:54 2008 +0000
@@ -53,15 +53,21 @@
 #define SDL_HAPTIC_FRICTION   (1<<4)
 #define SDL_HAPTIC_DAMPER     (1<<5)
 #define SDL_HAPTIC_INERTIA    (1<<6)
-#define SDL_HAPTIC_GAIN       (1<<7)
-#define SDL_HAPTIC_AUTOCENTER (1<<8)
+#define SDL_HAPTIC_CUSTOM     (1<<7)
+#define SDL_HAPTIC_GAIN       (1<<8)
+#define SDL_HAPTIC_AUTOCENTER (1<<9)
 
+
+/*
+ * Different waveforms a SDL_HAPTIC_PERIODIC effect can have.
+ */
 typedef enum SDL_waveform {
    SDL_WAVEFORM_SINE,
    SDL_WAVEFORM_SQUARE,
    SDL_WAVEFORM_TRIANGLE,
    SDL_WAVEFORM_SAWTOOTHUP,
-   SDL_WAVEFORM_SAWTOOTHDOWN
+   SDL_WAVEFORM_SAWTOOTHDOWN,
+   SDL_WAVEFORM_CUSTOM
 } SDL_waveform;
 
 
@@ -153,7 +159,6 @@
    Sint16 left_coeff; /* How fast to increase the force towards the left */
    Uint16 deadband; /* Size of the dead zone */
    Sint16 center; /* Position of the dead zone */
-
 } SDL_HapticCondition;
 typedef struct SDL_HapticRamp {
    /* Header */
@@ -177,7 +182,6 @@
    Uint16 attack_level;
    Uint16 fade_length;
    Uint16 fade_level;
-
 } SDL_HapticRamp;
 
 typedef union SDL_HapticEffect {
@@ -231,6 +235,14 @@
 extern DECLSPEC unsigned int SDL_HapticQueryEffects(SDL_Haptic * haptic);
 
 /*
+ * Checks to see if effect is supported by haptic.
+ *
+ * Returns SDL_TRUE if effect is supported, SDL_FALSE if it isn't and -1
+ * on error.
+ */
+extern DECLSPEC int SDL_HapticEffectSupported(SDL_Haptic * haptic, SDL_HapticEffect * effect);
+
+/*
  * Creates a new haptic effect on the device.
  *
  * Returns the id of the effect on success, -1 on failure.