comparison 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
comparison
equal deleted inserted replaced
2494:a72a5f62d6b7 2495:66c02abeef0e
436 436
437 SDL_SYS_HapticDestroyEffect(haptic, &haptic->effects[effect]); 437 SDL_SYS_HapticDestroyEffect(haptic, &haptic->effects[effect]);
438 } 438 }
439 439
440 /* 440 /*
441 * Gets the status of a haptic effect.
442 */
443 int
444 SDL_HapticGetEffectStatus(SDL_Haptic *haptic, int effect)
445 {
446 if (!ValidHaptic(&haptic) || !ValidEffect(haptic,effect)) {
447 return -1;
448 }
449
450 if ((haptic->supported & SDL_HAPTIC_STATUS) == 0) {
451 SDL_SetError("Haptic device does not support status queries.");
452 return -1;
453 }
454
455 return SDL_SYS_HapticGetEffectStatus(haptic, &haptic->effects[effect]);
456 }
457
458 /*
441 * Sets the global gain of the device. 459 * Sets the global gain of the device.
442 */ 460 */
443 int 461 int
444 SDL_HapticSetGain(SDL_Haptic * haptic, int gain ) 462 SDL_HapticSetGain(SDL_Haptic * haptic, int gain )
445 { 463 {