Wiki Page Content

Differences between revisions 1 and 2
Revision 1 as of 2010-03-22 18:21:03
Size: 1407
Editor: SheenaSmith
Comment: create page, add content (Rev 5321)
Revision 2 as of 2010-09-13 04:30:27
Size: 1938
Editor: SheenaSmith
Comment: improve content
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
Use this function to run the haptic effect on ''its associated'' haptic device. Use this function to run the haptic effect on its associated haptic device.
Line 18: Line 18:
||'''haptic'''||^a pointer to the^ haptic device to run the effect on||
||'''effect'''||^ID^ ,,identifier,, of the haptic effect to run||
||'''iterations'''||^the^ number of iterations to run the effect; use SDL_HAPTIC_INFINITY for infinity||
||'''haptic'''||^a pointer to the^ 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 23: Line 23:
Returns 0 on success, or -1 on error; call [[SDL_GetError]]() for more information. Returns 0 on success ^or a negative error code on failure^ ,,, or -1 on error,,; call [[SDL_GetError]]() for more information.
Line 31: Line 31:
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. <<Color2(green,This doesn't really make sense but I don't have enough info to suggest a fix.)>> 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.

''-or-''

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^.

<<Color2(green,Is it important to say how to end an effect that has an SDL_HAPTIC_INFINITY setting or is it enough to list the destroy function below?)>>

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

a pointer to the 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

Return Value

Returns 0 on success or a negative error code on failure , or -1 on error; 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.

-or-

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.

green


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