Mercurial > sdl-ios-xcode
comparison src/haptic/SDL_haptic.c @ 2645:269ba4f28d0e gsoc2008_force_feedback
Added support for pausing/unpausing haptic devices.
author | Edgar Simo <bobbens@gmail.com> |
---|---|
date | Sun, 24 Aug 2008 17:17:45 +0000 |
parents | 3696b9ce8a37 |
children | 9408be170bff |
comparison
equal
deleted
inserted
replaced
2644:ef0ba67154c1 | 2645:269ba4f28d0e |
---|---|
636 } | 636 } |
637 | 637 |
638 return 0; | 638 return 0; |
639 } | 639 } |
640 | 640 |
641 | 641 /* |
642 * Pauses the haptic device. | |
643 */ | |
644 int | |
645 SDL_HapticPause(SDL_Haptic * haptic) | |
646 { | |
647 if (!ValidHaptic(haptic)) { | |
648 return -1; | |
649 } | |
650 | |
651 if ((haptic->supported & SDL_HAPTIC_PAUSE) == 0) { | |
652 SDL_SetError("Haptic: Device does not support setting pausing."); | |
653 return -1; | |
654 } | |
655 | |
656 return SDL_SYS_HapticPause(haptic); | |
657 } | |
658 | |
659 /* | |
660 * Unpauses the haptic device. | |
661 */ | |
662 int | |
663 SDL_HapticUnpause(SDL_Haptic * haptic) | |
664 { | |
665 if (!ValidHaptic(haptic)) { | |
666 return -1; | |
667 } | |
668 | |
669 if ((haptic->supported & SDL_HAPTIC_PAUSE) == 0) { | |
670 return 0; /* Not going to be paused, so we pretend it's unpaused. */ | |
671 } | |
672 | |
673 return SDL_SYS_HapticUnpause(haptic); | |
674 } | |
675 |