Mercurial > sdl-ios-xcode
diff src/haptic/SDL_haptic.c @ 2495:66c02abeef0e gsoc2008_force_feedback
Added SDL_HapticGetEffectStatus().
More comments.
author | Edgar Simo <bobbens@gmail.com> |
---|---|
date | Thu, 03 Jul 2008 09:58:27 +0000 |
parents | 10bc7aaf5114 |
children | 0893fbf73b3d |
line wrap: on
line diff
--- a/src/haptic/SDL_haptic.c Thu Jul 03 09:13:22 2008 +0000 +++ b/src/haptic/SDL_haptic.c Thu Jul 03 09:58:27 2008 +0000 @@ -438,6 +438,24 @@ } /* + * Gets the status of a haptic effect. + */ +int +SDL_HapticGetEffectStatus(SDL_Haptic *haptic, int effect) +{ + if (!ValidHaptic(&haptic) || !ValidEffect(haptic,effect)) { + return -1; + } + + if ((haptic->supported & SDL_HAPTIC_STATUS) == 0) { + SDL_SetError("Haptic device does not support status queries."); + return -1; + } + + return SDL_SYS_HapticGetEffectStatus(haptic, &haptic->effects[effect]); +} + +/* * Sets the global gain of the device. */ int