comparison include/SDL_haptic.h @ 2535:f0ed8471497d gsoc2008_force_feedback

Added custom effect with support on darwin.
author Edgar Simo <bobbens@gmail.com>
date Sat, 19 Jul 2008 15:57:07 +0000
parents 688cad3f6090
children fe3ee345a5d2
comparison
equal deleted inserted replaced
2534:e597de8dccd5 2535:f0ed8471497d
588 Uint16 attack_length; /**< Duration of the attack. */ 588 Uint16 attack_length; /**< Duration of the attack. */
589 Uint16 attack_level; /**< Level at the start of the attack. */ 589 Uint16 attack_level; /**< Level at the start of the attack. */
590 Uint16 fade_length; /**< Duration of the fade. */ 590 Uint16 fade_length; /**< Duration of the fade. */
591 Uint16 fade_level; /**< Level at the end of the fade. */ 591 Uint16 fade_level; /**< Level at the end of the fade. */
592 } SDL_HapticRamp; 592 } SDL_HapticRamp;
593 /**
594 * \struct SDL_HapticCustom
595 *
596 * \brief A structure containing a template for the SDL_HAPTIC_CUSTOM effect.
597 *
598 * A custom force feedback effect is much like a periodic effect, where the
599 * application can define it's exact shape. You will have to allocate the
600 * data yourself. Data should consist of channels * samples Uint16 samples.
601 *
602 * If channels is one, the effect is rotated using the defined direction.
603 * Otherwise it uses the samples in data for the different axes.
604 *
605 * \sa SDL_HAPTIC_CUSTOM
606 * \sa SDL_HapticEffect
607 */
608 typedef struct SDL_HapticCustom {
609 /* Header */
610 Uint16 type; /**< SDL_HAPTIC_CUSTOM */
611 SDL_HapticDirection direction; /**< Direction of the effect. */
612
613 /* Replay */
614 Uint32 length; /**< Duration of the effect. */
615 Uint16 delay; /**< Delay before starting the effect. */
616
617 /* Trigger */
618 Uint16 button; /**< Button that triggers the effect. */
619 Uint16 interval; /**< How soon it can be triggered again after button. */
620
621 /* Custom */
622 Uint8 channels; /**< Axes to use, minimum of one. */
623 Uint16 period; /**< Sample periods. */
624 Uint16 samples; /**< Amount of samples. */
625 Uint16 *data; /**< Should contain channels*samples items. */
626
627 /* Envelope */
628 Uint16 attack_length; /**< Duration of the attack. */
629 Uint16 attack_level; /**< Level at the start of the attack. */
630 Uint16 fade_length; /**< Duration of the fade. */
631 Uint16 fade_level; /**< Level at the end of the fade. */
632 } SDL_HapticCustom;
593 /** 633 /**
594 * \union SDL_HapticEffect 634 * \union SDL_HapticEffect
595 * 635 *
596 * \brief The generic template for any haptic effect. 636 * \brief The generic template for any haptic effect.
597 * 637 *
650 * 690 *
651 * \sa SDL_HapticConstant 691 * \sa SDL_HapticConstant
652 * \sa SDL_HapticPeriodic 692 * \sa SDL_HapticPeriodic
653 * \sa SDL_HapticCondition 693 * \sa SDL_HapticCondition
654 * \sa SDL_HapticRamp 694 * \sa SDL_HapticRamp
695 * \sa SDL_HapticCustom
655 */ 696 */
656 typedef union SDL_HapticEffect { 697 typedef union SDL_HapticEffect {
657 /* Common for all force feedback effects */ 698 /* Common for all force feedback effects */
658 Uint16 type; /**< Effect type. */ 699 Uint16 type; /**< Effect type. */
659 SDL_HapticConstant constant; /**< Constant effect. */ 700 SDL_HapticConstant constant; /**< Constant effect. */
660 SDL_HapticPeriodic periodic; /**< Periodic effect. */ 701 SDL_HapticPeriodic periodic; /**< Periodic effect. */
661 SDL_HapticCondition condition; /**< Condition effect. */ 702 SDL_HapticCondition condition; /**< Condition effect. */
662 SDL_HapticRamp ramp; /**< Ramp effect. */ 703 SDL_HapticRamp ramp; /**< Ramp effect. */
704 SDL_HapticCustom custom; /**< Custom effect. */
663 } SDL_HapticEffect; 705 } SDL_HapticEffect;
664 706
665 707
666 /* Function prototypes */ 708 /* Function prototypes */
667 /** 709 /**