comparison src/haptic/darwin/SDL_syshaptic.c @ 2637:2f826c229d77 gsoc2008_force_feedback

First draft of darwin haptic<->joystick stuff.
author Edgar Simo <bobbens@gmail.com>
date Sun, 10 Aug 2008 19:45:38 +0000
parents 6b0d1f494c10
children 668fee3b268a
comparison
equal deleted inserted replaced
2636:57ac1594164e 2637:2f826c229d77
445 * Checks to see if a joystick has haptic features. 445 * Checks to see if a joystick has haptic features.
446 */ 446 */
447 int 447 int
448 SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick) 448 SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick)
449 { 449 {
450 if (joystick->hwdata->ffservice != 0)
451 return SDL_TRUE;
450 return SDL_FALSE; 452 return SDL_FALSE;
451 } 453 }
452 454
453 455
454 /* 456 /*
455 * Checks to see if the haptic device and joystick and in reality the same. 457 * Checks to see if the haptic device and joystick and in reality the same.
456 */ 458 */
457 int 459 int
458 SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick) 460 SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick)
459 { 461 {
462 if (IOObjectIsEqualTo(haptic->hwdata->device, joystick->hwdata->ffservice))
463 return 1;
460 return 0; 464 return 0;
461 } 465 }
462 466
463 467
464 /* 468 /*
465 * Opens a SDL_Haptic from a SDL_Joystick. 469 * Opens a SDL_Haptic from a SDL_Joystick.
466 */ 470 */
467 int 471 int
468 SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) 472 SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick)
469 { 473 {
470 return -1; 474 return SDL_SYS_HapticOpenFromService(haptic,
475 joystick->hwdata->ffservice);
471 } 476 }
472 477
473 478
474 /* 479 /*
475 * Closes the haptic device. 480 * Closes the haptic device.