Wiki Page Content

Differences between revisions 7 and 8
Revision 7 as of 2016-07-15 20:23:15
Size: 1978
Comment: Added Version section.
Revision 8 as of 2016-07-15 20:27:36
Size: 1987
Comment: Removed old formatting.
Deletions are marked like this. Additions are marked like this.
Line 18: Line 18:
||'''haptic'''||^the^ SDL_Haptic device to run the effect on||
||'''effect'''||^the ID^ ,,identifier,, of the haptic effect to run||
||'''iterations'''||^the^ number of iterations to run the effect; use SDL_HAPTIC_INFINITY for infinity ''-or-'' ^the number of times to repeat the effect; see [[#Remarks|Remarks]] for details^||
||'''haptic'''||the SDL_Haptic device to run the effect on||
||'''effect'''||the /* ID */ identifier of the haptic effect to run||
||'''iterations'''||the number of iterations to run the effect; use SDL_HAPTIC_INFINITY for infinity /* ''-or-'' the number of times to repeat the effect; see [[#Remarks|Remarks]] for details */ ||
Line 33: Line 33:
''-or-'' /* ''-or-'' */
Line 35: Line 35:
To repeat the effect over and over indefinitely, set '''iterations''' to SDL_HAPTIC_INFINITY. (Repeats the envelope - attack and fade.) To make one instance of the effect last indefinitely (so the effect does not fade), set the effect's `length` ^in its structure/union^ to SDL_HAPTIC_INFINITY ^instead^. /* To repeat the effect over and over indefinitely, set '''iterations''' to SDL_HAPTIC_INFINITY. (Repeats the envelope - attack and fade.) To make one instance of the effect last indefinitely (so the effect does not fade), set the effect's `length` in its structure/union to SDL_HAPTIC_INFINITY instead. */

DRAFT

SDL_HapticRunEffect

Use this function to run the haptic effect on its associated haptic device.

Syntax

int SDL_HapticRunEffect(SDL_Haptic* haptic,
                        int         effect,
                        Uint32      iterations)

Function Parameters

haptic

the SDL_Haptic device to run the effect on

effect

the identifier of the haptic effect to run

iterations

the number of iterations to run the effect; use SDL_HAPTIC_INFINITY for infinity

Return Value

Returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.

Code Examples

You can add your code example here

Remarks

If iterations are SDL_HAPTIC_INFINITY, it'll run the effect over and over repeating the envelope (attack and fade) every time. If you only want the effect to last forever, set SDL_HAPTIC_INFINITY in the effect's length parameter.

Version

This function is available since SDL 2.0.0.


CategoryAPI, CategoryForceFeedback

None: SDL_HapticRunEffect (last edited 2016-07-15 20:27:36 by PhilippWiesemann)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit