include/SDL_haptic.h
changeset 7120 bc4424a5a38f
parent 6885 700f1b25f77f
child 7125 082c0c53ac16
equal deleted inserted replaced
7119:b0ad5dd4cabb 7120:bc4424a5a38f
   893 
   893 
   894 /**
   894 /**
   895  *  \brief Returns the number of effects a haptic device can store.
   895  *  \brief Returns the number of effects a haptic device can store.
   896  *  
   896  *  
   897  *  On some platforms this isn't fully supported, and therefore is an
   897  *  On some platforms this isn't fully supported, and therefore is an
   898  *  aproximation.  Always check to see if your created effect was actually
   898  *  approximation.  Always check to see if your created effect was actually
   899  *  created and do not rely solely on SDL_HapticNumEffects().
   899  *  created and do not rely solely on SDL_HapticNumEffects().
   900  *  
   900  *  
   901  *  \param haptic The haptic device to query effect max.
   901  *  \param haptic The haptic device to query effect max.
   902  *  \return The number of effects the haptic device can store or
   902  *  \return The number of effects the haptic device can store or
   903  *          -1 on error.
   903  *          -1 on error.
   910 /**
   910 /**
   911  *  \brief Returns the number of effects a haptic device can play at the same 
   911  *  \brief Returns the number of effects a haptic device can play at the same 
   912  *         time.
   912  *         time.
   913  *  
   913  *  
   914  *  This is not supported on all platforms, but will always return a value.  
   914  *  This is not supported on all platforms, but will always return a value.  
   915  *  Added here for the sake of completness.
   915  *  Added here for the sake of completeness.
   916  *  
   916  *  
   917  *  \param haptic The haptic device to query maximum playing effects.
   917  *  \param haptic The haptic device to query maximum playing effects.
   918  *  \return The number of effects the haptic device can play at the same time
   918  *  \return The number of effects the haptic device can play at the same time
   919  *          or -1 on error.
   919  *          or -1 on error.
   920  *
   920  *
   997 extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic,
   997 extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic,
   998                                                    int effect,
   998                                                    int effect,
   999                                                    SDL_HapticEffect * data);
   999                                                    SDL_HapticEffect * data);
  1000 
  1000 
  1001 /**
  1001 /**
  1002  *  \brief Runs the haptic effect on it's assosciated haptic device.
  1002  *  \brief Runs the haptic effect on it's associated haptic device.
  1003  *  
  1003  *  
  1004  *  If iterations are ::SDL_HAPTIC_INFINITY, it'll run the effect over and over
  1004  *  If iterations are ::SDL_HAPTIC_INFINITY, it'll run the effect over and over
  1005  *  repeating the envelope (attack and fade) every time.  If you only want the
  1005  *  repeating the envelope (attack and fade) every time.  If you only want the
  1006  *  effect to last forever, set ::SDL_HAPTIC_INFINITY in the effect's length
  1006  *  effect to last forever, set ::SDL_HAPTIC_INFINITY in the effect's length
  1007  *  parameter.
  1007  *  parameter.
  1019 extern DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic * haptic,
  1019 extern DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic * haptic,
  1020                                                 int effect,
  1020                                                 int effect,
  1021                                                 Uint32 iterations);
  1021                                                 Uint32 iterations);
  1022 
  1022 
  1023 /**
  1023 /**
  1024  *  \brief Stops the haptic effect on it's assosciated haptic device.
  1024  *  \brief Stops the haptic effect on it's associated haptic device.
  1025  *  
  1025  *  
  1026  *  \param haptic Haptic device to stop the effect on.
  1026  *  \param haptic Haptic device to stop the effect on.
  1027  *  \param effect Identifier of the effect to stop.
  1027  *  \param effect Identifier of the effect to stop.
  1028  *  \return 0 on success or -1 on error.
  1028  *  \return 0 on success or -1 on error.
  1029  *  
  1029  *  
  1066 /**
  1066 /**
  1067  *  \brief Sets the global gain of the device.
  1067  *  \brief Sets the global gain of the device.
  1068  *  
  1068  *  
  1069  *  Device must support the ::SDL_HAPTIC_GAIN feature.
  1069  *  Device must support the ::SDL_HAPTIC_GAIN feature.
  1070  *  
  1070  *  
  1071  *  The user may specify the maxmimum gain by setting the environment variable
  1071  *  The user may specify the maximum gain by setting the environment variable
  1072  *  ::SDL_HAPTIC_GAIN_MAX which should be between 0 and 100.  All calls to
  1072  *  ::SDL_HAPTIC_GAIN_MAX which should be between 0 and 100.  All calls to
  1073  *  SDL_HapticSetGain() will scale linearly using ::SDL_HAPTIC_GAIN_MAX as the
  1073  *  SDL_HapticSetGain() will scale linearly using ::SDL_HAPTIC_GAIN_MAX as the
  1074  *  maximum.
  1074  *  maximum.
  1075  *  
  1075  *  
  1076  *  \param haptic Haptic device to set the gain on.
  1076  *  \param haptic Haptic device to set the gain on.
  1162 /**
  1162 /**
  1163  *  \brief Runs simple rumble on a haptic device
  1163  *  \brief Runs simple rumble on a haptic device
  1164  *
  1164  *
  1165  *  \param haptic Haptic device to play rumble effect on.
  1165  *  \param haptic Haptic device to play rumble effect on.
  1166  *  \param strength Strength of the rumble to play as a 0-1 float value.
  1166  *  \param strength Strength of the rumble to play as a 0-1 float value.
  1167  *  \param length Length of the rumble to play in miliseconds.
  1167  *  \param length Length of the rumble to play in milliseconds.
  1168  *  \return 0 on success or -1 on error.
  1168  *  \return 0 on success or -1 on error.
  1169  *
  1169  *
  1170  *  \sa SDL_HapticRumbleSupported
  1170  *  \sa SDL_HapticRumbleSupported
  1171  *  \sa SDL_HapticRumbleInit
  1171  *  \sa SDL_HapticRumbleInit
  1172  *  \sa SDL_HapticRumbleStop
  1172  *  \sa SDL_HapticRumbleStop