comparison src/haptic/linux/SDL_syshaptic.c @ 2485:67978eea6d10 gsoc2008_force_feedback

Added SDL_HapticStopEffect().
author Edgar Simo <bobbens@gmail.com>
date Tue, 01 Jul 2008 14:31:04 +0000
parents 666472fd4cb0
children 24dd8b8669fa
comparison
equal deleted inserted replaced
2484:666472fd4cb0 2485:67978eea6d10
493 return 0; 493 return 0;
494 } 494 }
495 495
496 496
497 /* 497 /*
498 * Stops an effect.
499 */
500 int
501 SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect * effect)
502 {
503 struct input_event stop;
504
505 stop.type = EV_FF;
506 stop.code = effect->hweffect->effect.id;
507 stop.value = 0;
508
509 if (write(haptic->hwdata->fd, (const void*) &stop, sizeof(stop)) < 0) {
510 SDL_SetError("Unable to stop the haptic effect.");
511 return -1;
512 }
513
514 return 0;
515 }
516
517
518 /*
498 * Frees the effect 519 * Frees the effect
499 */ 520 */
500 void 521 void
501 SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect * effect) 522 SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect * effect)
502 { 523 {