src/haptic/win32/SDL_syshaptic.c
branchgsoc2008_force_feedback
changeset 2626 53dd30491c71
parent 2623 6deba05725ac
child 2629 43a0416b3707
--- a/src/haptic/win32/SDL_syshaptic.c	Wed Aug 06 09:55:51 2008 +0000
+++ b/src/haptic/win32/SDL_syshaptic.c	Wed Aug 06 10:11:35 2008 +0000
@@ -465,6 +465,9 @@
       haptic->supported |= SDL_HAPTIC_AUTOCENTER;
    }
 
+   /* Status is always supported. */
+   haptic->supported |= SDL_HAPTIC_STATUS;
+
    /* Check maximum effects. */
    haptic->neffects = 128; /* TODO actually figure this out. */
    haptic->nplaying = 128;
@@ -1231,8 +1234,17 @@
 int
 SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic, struct haptic_effect * effect)
 {
-   SDL_SetError("Haptic: Status not supported.");
-   return -1;
+   HRESULT ret;
+   DWORD status;
+
+   ret = IDirectInputEffect_GetEffectStatus(effect->hweffect->ref, &status);
+   if (FAILED(ret)) {
+      DI_SetError("Getting effect status",ret);
+      return -1;
+   }
+
+   if (status == 0) return SDL_FALSE;
+   return SDL_TRUE;
 }