src/haptic/SDL_haptic.c
branchgsoc2008_force_feedback
changeset 2495 66c02abeef0e
parent 2491 10bc7aaf5114
child 2497 0893fbf73b3d
     1.1 --- a/src/haptic/SDL_haptic.c	Thu Jul 03 09:13:22 2008 +0000
     1.2 +++ b/src/haptic/SDL_haptic.c	Thu Jul 03 09:58:27 2008 +0000
     1.3 @@ -438,6 +438,24 @@
     1.4  }
     1.5  
     1.6  /*
     1.7 + * Gets the status of a haptic effect.
     1.8 + */
     1.9 +int
    1.10 +SDL_HapticGetEffectStatus(SDL_Haptic *haptic, int effect)
    1.11 +{
    1.12 +   if (!ValidHaptic(&haptic) || !ValidEffect(haptic,effect)) {
    1.13 +      return -1;
    1.14 +   }
    1.15 +
    1.16 +   if ((haptic->supported & SDL_HAPTIC_STATUS) == 0) {
    1.17 +      SDL_SetError("Haptic device does not support status queries.");
    1.18 +      return -1;
    1.19 +   }
    1.20 +
    1.21 +   return SDL_SYS_HapticGetEffectStatus(haptic, &haptic->effects[effect]);
    1.22 +}
    1.23 +
    1.24 +/*
    1.25   * Sets the global gain of the device.
    1.26   */
    1.27  int