src/haptic/SDL_haptic.c
branchgsoc2008_force_feedback
changeset 2645 269ba4f28d0e
parent 2561 3696b9ce8a37
child 2646 9408be170bff
     1.1 --- a/src/haptic/SDL_haptic.c	Tue Aug 12 20:49:31 2008 +0000
     1.2 +++ b/src/haptic/SDL_haptic.c	Sun Aug 24 17:17:45 2008 +0000
     1.3 @@ -638,4 +638,38 @@
     1.4     return 0;
     1.5  }
     1.6  
     1.7 +/*
     1.8 + * Pauses the haptic device.
     1.9 + */
    1.10 +int
    1.11 +SDL_HapticPause(SDL_Haptic * haptic)
    1.12 +{
    1.13 +   if (!ValidHaptic(haptic)) {
    1.14 +      return -1;
    1.15 +   }
    1.16  
    1.17 +   if ((haptic->supported & SDL_HAPTIC_PAUSE) == 0) {
    1.18 +      SDL_SetError("Haptic: Device does not support setting pausing.");
    1.19 +      return -1;
    1.20 +   }
    1.21 +
    1.22 +   return SDL_SYS_HapticPause(haptic);
    1.23 +}
    1.24 +
    1.25 +/*
    1.26 + * Unpauses the haptic device.
    1.27 + */
    1.28 +int
    1.29 +SDL_HapticUnpause(SDL_Haptic * haptic)
    1.30 +{
    1.31 +   if (!ValidHaptic(haptic)) {
    1.32 +      return -1;
    1.33 +   }
    1.34 +
    1.35 +   if ((haptic->supported & SDL_HAPTIC_PAUSE) == 0) {
    1.36 +      return 0; /* Not going to be paused, so we pretend it's unpaused. */
    1.37 +   }
    1.38 +
    1.39 +   return SDL_SYS_HapticUnpause(haptic);
    1.40 +}
    1.41 +