src/haptic/win32/SDL_syshaptic.c
branchgsoc2008_force_feedback
changeset 2645 269ba4f28d0e
parent 2631 a0845d7f4398
child 2646 9408be170bff
     1.1 --- a/src/haptic/win32/SDL_syshaptic.c	Tue Aug 12 20:49:31 2008 +0000
     1.2 +++ b/src/haptic/win32/SDL_syshaptic.c	Sun Aug 24 17:17:45 2008 +0000
     1.3 @@ -466,7 +466,7 @@
     1.4     }
     1.5  
     1.6     /* Status is always supported. */
     1.7 -   haptic->supported |= SDL_HAPTIC_STATUS;
     1.8 +   haptic->supported |= SDL_HAPTIC_STATUS | SDL_HAPTIC_PAUSE;
     1.9  
    1.10     /* Check maximum effects. */
    1.11     haptic->neffects = 128; /* This is not actually supported as thus under windows,
    1.12 @@ -1301,8 +1301,47 @@
    1.13     }
    1.14    
    1.15     return 0;
    1.16 -
    1.17  }
    1.18  
    1.19  
    1.20 +/*
    1.21 + * Pauses the device.
    1.22 + */
    1.23 +int
    1.24 +SDL_SYS_HapticPause(SDL_Haptic * haptic)
    1.25 +{
    1.26 +   HRESULT ret;
    1.27 +
    1.28 +   /* Pause the device. */
    1.29 +   ret = IDirectInputDevice2_SendForceFeedbackCommand( haptic->hwdata->device,
    1.30 +                                                       DISFFC_PAUSE );
    1.31 +   if (FAILED(ret)) {
    1.32 +      DI_SetError("Pausing the device",ret);
    1.33 +      return -1;
    1.34 +   }
    1.35 +   
    1.36 +   return 0;
    1.37 +}
    1.38 +
    1.39 +
    1.40 +/*
    1.41 + * Pauses the device.
    1.42 + */
    1.43 +int
    1.44 +SDL_SYS_HapticUnpause(SDL_Haptic * haptic)
    1.45 +{
    1.46 +   HRESULT ret;
    1.47 +
    1.48 +   /* Unpause the device. */
    1.49 +   ret = IDirectInputDevice2_SendForceFeedbackCommand( haptic->hwdata->device,
    1.50 +                                                       DISFFC_CONTINUE );
    1.51 +   if (FAILED(ret)) {
    1.52 +      DI_SetError("Pausing the device",ret);
    1.53 +      return -1;
    1.54 +   }
    1.55 +   
    1.56 +   return 0;
    1.57 +}
    1.58 +
    1.59 +
    1.60  #endif /* SDL_HAPTIC_DINPUT */