We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1135 - Simple rumble API for haptic
Summary: Simple rumble API for haptic
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: main (show other bugs)
Version: HG 2.0
Hardware: x86_64 All
: P2 enhancement
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-20 10:27 UTC by Edgar Simo
Modified: 2011-02-20 10:55 UTC (History)
0 users

See Also:


Attachments
Patch that adds simple rumble API to SDL. (12.30 KB, patch)
2011-02-20 10:27 UTC, Edgar Simo
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Edgar Simo 2011-02-20 10:27:52 UTC
Created attachment 582 [details]
Patch that adds simple rumble API to SDL.

Adding patch that adds a simplified API for the haptic subsystem built ontop of the "real one" for those who want simple rumble without jumping through hoops.

Adds 4 functions:

- extern DECLSPEC int SDLCALL SDL_HapticRumbleSupported(SDL_Haptic * haptic);
- extern DECLSPEC int SDLCALL SDL_HapticRumbleInit(SDL_Haptic * haptic);
- extern DECLSPEC int SDLCALL SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length );
- extern DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic * haptic);

Also provided is test/testrumble.c which does test this.

This has all been tested on linux and has worked, but due to being built ontop of the other haptic API it should work on all OS the same.

On a side note there is no "haptic" component in the bug tracker.
Comment 1 Sam Lantinga 2011-02-20 10:55:40 UTC
Added, thanks! :)
http://hg.libsdl.org/SDL/rev/220d3af9121f