• Sam Lantinga's avatar
    Simple rumble API for haptic · f2209fb4
    Sam Lantinga authored
     Edgar Simo      2011-02-20 10:27:52 PST
    
    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.
    f2209fb4
SDL_haptic.c 16.8 KB