[SVN] r3913 - branches/gsoc2008_force_feedback/src/haptic/win32
svn-owner at libsdl.org
svn-owner at libsdl.org
Wed Aug 6 03:11:36 PDT 2008
Author: bobbens
Date: 2008-08-06 03:11:35 -0700 (Wed, 06 Aug 2008)
New Revision: 3913
Modified:
branches/gsoc2008_force_feedback/src/haptic/win32/SDL_syshaptic.c
Log:
Added SDL_HAPTIC_STATUS support to windows haptic port.
Modified: branches/gsoc2008_force_feedback/src/haptic/win32/SDL_syshaptic.c
===================================================================
--- branches/gsoc2008_force_feedback/src/haptic/win32/SDL_syshaptic.c 2008-08-06 09:55:51 UTC (rev 3912)
+++ branches/gsoc2008_force_feedback/src/haptic/win32/SDL_syshaptic.c 2008-08-06 10:11:35 UTC (rev 3913)
@@ -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;
}
More information about the SVN
mailing list