include/SDL_haptic.h
branchgsoc2008_force_feedback
changeset 2517 37c13c12c878
parent 2515 030fc4375e63
child 2519 af9df9662807
equal deleted inserted replaced
2516:6da022b18314 2517:37c13c12c878
    68  *
    68  *
    69  *    // Upload the effect
    69  *    // Upload the effect
    70  *    effect_id = SDL_HapticNewEffect( haptic, &effect );
    70  *    effect_id = SDL_HapticNewEffect( haptic, &effect );
    71  *
    71  *
    72  *    // Test the effect
    72  *    // Test the effect
    73  *    SDL_HapticRunEffect( haptic, effect_id );
    73  *    SDL_HapticRunEffect( haptic, effect_id, 1 );
    74  *    SDL_Delay( 5000); // Wait for the effect to finish
    74  *    SDL_Delay( 5000); // Wait for the effect to finish
    75  *
    75  *
    76  *    // We destroy the effect, although closing the device also does this
    76  *    // We destroy the effect, although closing the device also does this
    77  *    SDL_HapticDestroyEffect( haptic, effect_id );
    77  *    SDL_HapticDestroyEffect( haptic, effect_id );
    78  *
    78  *
   259  * \brief Uses cartesian coordinates for the direction.
   259  * \brief Uses cartesian coordinates for the direction.
   260  *
   260  *
   261  * \sa SDL_HapticDirection
   261  * \sa SDL_HapticDirection
   262  */
   262  */
   263 #define SDL_HAPTIC_CARTESIAN  1
   263 #define SDL_HAPTIC_CARTESIAN  1
       
   264 
       
   265 
       
   266 /*
       
   267  * Misc defines.
       
   268  */
       
   269 /**
       
   270  * \def SDL_HAPTIC_INFINITY
       
   271  *
       
   272  * \brief Used to play a device an infinite number of times.
       
   273  *
       
   274  * \sa SDL_HapticRunEffect
       
   275  */
       
   276 #define SDL_HAPTIC_INFINITY   -1
   264 
   277 
   265 
   278 
   266 /**
   279 /**
   267  * \struct SDL_HapticDirection
   280  * \struct SDL_HapticDirection
   268  *
   281  *
   679  *
   692  *
   680  *    \return SDL_TRUE if the mouse is haptic, SDL_FALSE if it isn't.
   693  *    \return SDL_TRUE if the mouse is haptic, SDL_FALSE if it isn't.
   681  *
   694  *
   682  * \sa SDL_HapticOpenFromMouse
   695  * \sa SDL_HapticOpenFromMouse
   683  */
   696  */
   684 extern DECLSPEC SDL_MouseIsHaptic(void);
   697 extern DECLSPEC int SDL_MouseIsHaptic(void);
   685 
   698 
   686 /**
   699 /**
   687  * \fn SDL_Haptic * SDL_HapticOpenFromMouse(void)
   700  * \fn SDL_Haptic * SDL_HapticOpenFromMouse(void)
   688  *
   701  *
   689  * \brief Tries to open a haptic device from the current mouse.
   702  * \brief Tries to open a haptic device from the current mouse.
   828  * \sa SDL_HapticDestroyEffect
   841  * \sa SDL_HapticDestroyEffect
   829  */
   842  */
   830 extern DECLSPEC int SDL_HapticUpdateEffect(SDL_Haptic * haptic, int effect, SDL_HapticEffect * data);
   843 extern DECLSPEC int SDL_HapticUpdateEffect(SDL_Haptic * haptic, int effect, SDL_HapticEffect * data);
   831 
   844 
   832 /**
   845 /**
   833  * \fn int SDL_HapticRunEffect(SDL_Haptic * haptic, int effect)
   846  * \fn int SDL_HapticRunEffect(SDL_Haptic * haptic, int effect, int iterations)
   834  *
   847  *
   835  * \brief Runs the haptic effect on it's assosciated haptic device.
   848  * \brief Runs the haptic effect on it's assosciated haptic device.
   836  *
   849  *
   837  *    \param haptic Haptic device to run the effect on.
   850  *    \param haptic Haptic device to run the effect on.
   838  *    \param effect Identifier of the haptic effect to run.
   851  *    \param effect Identifier of the haptic effect to run.
       
   852  *    \param iterations Number of iterations to run the effect. Use
       
   853  *           SDL_HAPTIC_INFINITY for infinity.
   839  *    \return 0 on success or -1 on error.
   854  *    \return 0 on success or -1 on error.
   840  *
   855  *
   841  * \sa SDL_HapticStopEffect
   856  * \sa SDL_HapticStopEffect
   842  * \sa SDL_HapticDestroyEffect
   857  * \sa SDL_HapticDestroyEffect
   843  * \sa SDL_HapticGetEffectStatus
   858  * \sa SDL_HapticGetEffectStatus
   844  */
   859  */
   845 extern DECLSPEC int SDL_HapticRunEffect(SDL_Haptic * haptic, int effect);
   860 extern DECLSPEC int SDL_HapticRunEffect(SDL_Haptic * haptic, int effect, int iterations);
   846 
   861 
   847 /**
   862 /**
   848  * \fn int SDL_HapticStopEffect(SDL_Haptic * haptic, int effect)
   863  * \fn int SDL_HapticStopEffect(SDL_Haptic * haptic, int effect)
   849  *
   864  *
   850  * \brief Stops the haptic effect on it's assosciated haptic device.
   865  * \brief Stops the haptic effect on it's assosciated haptic device.