src/haptic/win32/SDL_syshaptic.c
branchgsoc2008_force_feedback
changeset 2626 53dd30491c71
parent 2623 6deba05725ac
child 2629 43a0416b3707
     1.1 --- a/src/haptic/win32/SDL_syshaptic.c	Wed Aug 06 09:55:51 2008 +0000
     1.2 +++ b/src/haptic/win32/SDL_syshaptic.c	Wed Aug 06 10:11:35 2008 +0000
     1.3 @@ -465,6 +465,9 @@
     1.4        haptic->supported |= SDL_HAPTIC_AUTOCENTER;
     1.5     }
     1.6  
     1.7 +   /* Status is always supported. */
     1.8 +   haptic->supported |= SDL_HAPTIC_STATUS;
     1.9 +
    1.10     /* Check maximum effects. */
    1.11     haptic->neffects = 128; /* TODO actually figure this out. */
    1.12     haptic->nplaying = 128;
    1.13 @@ -1231,8 +1234,17 @@
    1.14  int
    1.15  SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic, struct haptic_effect * effect)
    1.16  {
    1.17 -   SDL_SetError("Haptic: Status not supported.");
    1.18 -   return -1;
    1.19 +   HRESULT ret;
    1.20 +   DWORD status;
    1.21 +
    1.22 +   ret = IDirectInputEffect_GetEffectStatus(effect->hweffect->ref, &status);
    1.23 +   if (FAILED(ret)) {
    1.24 +      DI_SetError("Getting effect status",ret);
    1.25 +      return -1;
    1.26 +   }
    1.27 +
    1.28 +   if (status == 0) return SDL_FALSE;
    1.29 +   return SDL_TRUE;
    1.30  }
    1.31  
    1.32