Home | History | Annotate | Download | only in SDL2

Lines Matching refs:haptic

25  *  \brief The SDL Haptic subsystem allows you to control haptic (force feedback)
30 * - Open a Haptic Device.
37 * - Close the haptic device with SDL_HapticClose().
41 * SDL_Haptic *haptic;
44 * haptic = SDL_HapticOpen( 0 );
45 * if (haptic == NULL)
49 * if (SDL_HapticRumbleInit( haptic ) != 0)
53 * if (SDL_HapticRumblePlay( haptic, 0.5, 2000 ) != 0)
58 * SDL_HapticClose( haptic );
64 * SDL_Haptic *haptic;
69 * haptic = SDL_HapticOpenFromJoystick( joystick );
70 * if (haptic == NULL) return -1; // Most likely joystick isn't haptic
73 * if ((SDL_HapticQuery(haptic) & SDL_HAPTIC_SINE)==0) {
74 * SDL_HapticClose(haptic); // No sine effect
90 * effect_id = SDL_HapticNewEffect( haptic, &effect );
93 * SDL_HapticRunEffect( haptic, effect_id, 1 );
97 * SDL_HapticDestroyEffect( haptic, effect_id );
100 * SDL_HapticClose(haptic);
128 * \brief The haptic structure used to identify an SDL haptic.
139 * \name Haptic features
141 * Different haptic features a device can have.
146 * \name Haptic effects
153 * Constant haptic effect.
162 * Periodic haptic effect that simulates sine waves.
171 * Haptic effect for direct control over high/low frequency motors.
185 * Periodic haptic effect that simulates triangular waves.
194 * Periodic haptic effect that simulates saw tooth up waves.
203 * Periodic haptic effect that simulates saw tooth down waves.
212 * Ramp haptic effect.
221 * Condition haptic effect that simulates a spring. Effect is based on the
231 * Condition haptic effect that simulates dampening. Effect is based on the
241 * Condition haptic effect that simulates inertia. Effect is based on the axes
251 * Condition haptic effect that simulates friction. Effect is based on the
261 * User defined custom haptic effect.
265 /* @} *//* Haptic effects */
333 /* @} *//* Haptic features */
348 * \brief Structure that represents a haptic direction.
355 * Cardinal directions of the haptic device are relative to the positioning
373 (1,0) West <----[ HAPTIC ]----> East (-1,0)
719 * \brief The generic template for any haptic effect.
802 * \brief Count the number of haptic devices attached to the system.
804 * \return Number of haptic devices detected on the system.
809 * \brief Get the implementation dependent name of a Haptic device.
822 * \brief Opens a Haptic device for usage.
824 * The index passed as an argument refers to the N'th Haptic device on this
827 * When opening a haptic device, its gain will be set to maximum and
846 * \brief Checks if the haptic device at index has been opened.
857 * \brief Gets the index of a haptic device.
859 * \param haptic Haptic device to get the index of.
860 * \return The index of the haptic device or -1 on error.
865 extern DECLSPEC int SDLCALL SDL_HapticIndex(SDL_Haptic * haptic);
868 * \brief Gets whether or not the current mouse has haptic capabilities.
870 * \return SDL_TRUE if the mouse is haptic, SDL_FALSE if it isn't.
877 * \brief Tries to open a haptic device from the current mouse.
879 * \return The haptic device identifier or NULL on error.
887 * \brief Checks to see if a joystick has haptic features.
889 * \param joystick Joystick to test for haptic capabilities.
890 * \return 1 if the joystick is haptic, 0 if it isn't
898 * \brief Opens a Haptic device for usage from a Joystick device.
900 * You must still close the haptic device seperately. It will not be closed
903 * When opening from a joystick you should first close the haptic device before
904 * closing the joystick device. If not, on some implementations the haptic
908 * \param joystick Joystick to create a haptic device from.
909 * \return A valid haptic device identifier on success or NULL on error.
918 * \brief Closes a Haptic device previously opened with SDL_HapticOpen().
920 * \param haptic Haptic device to close.
922 extern DECLSPEC void SDLCALL SDL_HapticClose(SDL_Haptic * haptic);
925 * \brief Returns the number of effects a haptic device can store.
931 * \param haptic The haptic device to query effect max.
932 * \return The number of effects the haptic device can store or
938 extern DECLSPEC int SDLCALL SDL_HapticNumEffects(SDL_Haptic * haptic);
941 * \brief Returns the number of effects a haptic device can play at the same
947 * \param haptic The haptic device to query maximum playing effects.
948 * \return The number of effects the haptic device can play at the same time
954 extern DECLSPEC int SDLCALL SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic);
957 * \brief Gets the haptic devices supported features in bitwise matter.
961 * if (SDL_HapticQuery(haptic) & SDL_HAPTIC_CONSTANT) {
962 * printf("We have constant haptic effect!");
966 * \param haptic The haptic device to query.
967 * \return Haptic features in bitwise manner (OR'd).
972 extern DECLSPEC unsigned int SDLCALL SDL_HapticQuery(SDL_Haptic * haptic);
976 * \brief Gets the number of haptic axes the device has.
980 extern DECLSPEC int SDLCALL SDL_HapticNumAxes(SDL_Haptic * haptic);
983 * \brief Checks to see if effect is supported by haptic.
985 * \param haptic Haptic device to check on.
992 extern DECLSPEC int SDLCALL SDL_HapticEffectSupported(SDL_Haptic * haptic,
997 * \brief Creates a new haptic effect on the device.
999 * \param haptic Haptic device to create the effect on.
1007 extern DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic * haptic,
1018 * \param haptic Haptic device that has the effect.
1027 extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic,
1032 * \brief Runs the haptic effect on its associated haptic device.
1039 * \param haptic Haptic device to run the effect on.
1040 * \param effect Identifier of the haptic effect to run.
1049 extern DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic * haptic,
1054 * \brief Stops the haptic effect on its associated haptic device.
1056 * \param haptic Haptic device to stop the effect on.
1063 extern DECLSPEC int SDLCALL SDL_HapticStopEffect(SDL_Haptic * haptic,
1067 * \brief Destroys a haptic effect on the device.
1072 * \param haptic Device to destroy the effect on.
1077 extern DECLSPEC void SDLCALL SDL_HapticDestroyEffect(SDL_Haptic * haptic,
1081 * \brief Gets the status of the current effect on the haptic device.
1085 * \param haptic Haptic device to query the effect status on.
1092 extern DECLSPEC int SDLCALL SDL_HapticGetEffectStatus(SDL_Haptic * haptic,
1105 * \param haptic Haptic device to set the gain on.
1111 extern DECLSPEC int SDLCALL SDL_HapticSetGain(SDL_Haptic * haptic, int gain);
1121 * \param haptic Haptic device to set autocentering on.
1127 extern DECLSPEC int SDLCALL SDL_HapticSetAutocenter(SDL_Haptic * haptic,
1131 * \brief Pauses a haptic device.
1139 * \param haptic Haptic device to pause.
1144 extern DECLSPEC int SDLCALL SDL_HapticPause(SDL_Haptic * haptic);
1147 * \brief Unpauses a haptic device.
1151 * \param haptic Haptic device to pause.
1156 extern DECLSPEC int SDLCALL SDL_HapticUnpause(SDL_Haptic * haptic);
1159 * \brief Stops all the currently playing effects on a haptic device.
1161 * \param haptic Haptic device to stop.
1164 extern DECLSPEC int SDLCALL SDL_HapticStopAll(SDL_Haptic * haptic);
1167 * \brief Checks to see if rumble is supported on a haptic device.
1169 * \param haptic Haptic device to check to see if it supports rumble.
1176 extern DECLSPEC int SDLCALL SDL_HapticRumbleSupported(SDL_Haptic * haptic);
1179 * \brief Initializes the haptic device for simple rumble playback.
1181 * \param haptic Haptic device to initialize for simple rumble playback.
1189 extern DECLSPEC int SDLCALL SDL_HapticRumbleInit(SDL_Haptic * haptic);
1192 * \brief Runs simple rumble on a haptic device
1194 * \param haptic Haptic device to play rumble effect on.
1203 extern DECLSPEC int SDLCALL SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length );
1206 * \brief Stops the simple rumble on a haptic device.
1208 * \param haptic Haptic to stop the rumble on.
1215 extern DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic * haptic);