src/haptic/SDL_syshaptic.h
branchgsoc2008_force_feedback
changeset 2491 10bc7aaf5114
parent 2488 8e2bdbccf7ff
child 2495 66c02abeef0e
     1.1 --- a/src/haptic/SDL_syshaptic.h	Wed Jul 02 09:52:44 2008 +0000
     1.2 +++ b/src/haptic/SDL_syshaptic.h	Wed Jul 02 10:26:35 2008 +0000
     1.3 @@ -47,22 +47,116 @@
     1.4     int ref_count; /* Count for multiple opens */
     1.5  };
     1.6  
     1.7 +/* 
     1.8 + * Scans the system for haptic devices.
     1.9 + *
    1.10 + * Returns 0 on success, -1 on error.
    1.11 + */
    1.12  extern int SDL_SYS_HapticInit(void);
    1.13 +
    1.14 +/*
    1.15 + * Gets the device dependent name of the haptic device
    1.16 + */
    1.17  extern const char * SDL_SYS_HapticName(int index);
    1.18 +
    1.19 +/*
    1.20 + * Opens the haptic device for usage.  The haptic device should have
    1.21 + * the index value set previously.
    1.22 + *
    1.23 + * Returns 0 on success, -1 on error.
    1.24 + */
    1.25  extern int SDL_SYS_HapticOpen(SDL_Haptic * haptic);
    1.26 +
    1.27 +/*
    1.28 + * Checks to see if the joystick has haptic capabilities.
    1.29 + *
    1.30 + * Returns >0 if haptic capabilities are detected, 0 if haptic
    1.31 + * capabilities aren't detected and -1 on error.
    1.32 + */
    1.33 +extern int SDL_JoystickIsHaptic(SDL_Joystick * joystick);
    1.34 +
    1.35 +/*
    1.36 + * Opens the haptic device for usage using the same device as
    1.37 + * the joystick.
    1.38 + *
    1.39 + * Returns 0 on success, -1 on error.
    1.40 + */
    1.41 +extern int SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic,
    1.42 +                                          SDL_Joystick * joystick);
    1.43 +
    1.44 +/*
    1.45 + * Checks to see if haptic device and joystick device are the same.
    1.46 + *
    1.47 + * Returns 1 if they are the same, 0 if they aren't.
    1.48 + */
    1.49 +extern int SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic,
    1.50 +                                      SDL_Joystick * joystick);
    1.51 +
    1.52 +/*
    1.53 + * Closes a haptic device after usage.
    1.54 + */
    1.55  extern void SDL_SYS_HapticClose(SDL_Haptic * haptic);
    1.56 +
    1.57 +/*
    1.58 + * Performs a cleanup on the haptic subsystem.
    1.59 + */
    1.60  extern void SDL_SYS_HapticQuit(void);
    1.61 +
    1.62 +/*
    1.63 + * Creates a new haptic effect on the haptic device using base
    1.64 + * as a template for the effect.
    1.65 + *
    1.66 + * Returns 0 on success, -1 on error.
    1.67 + */
    1.68  extern int SDL_SYS_HapticNewEffect(SDL_Haptic * haptic,
    1.69 -      struct haptic_effect * effect, SDL_HapticEffect * base);
    1.70 +                                 struct haptic_effect * effect,
    1.71 +                                 SDL_HapticEffect * base);
    1.72 +
    1.73 +/*
    1.74 + * Updates the haptic effect on the haptic device using data
    1.75 + * as a template.
    1.76 + *
    1.77 + * Returns 0 on success, -1 on error.
    1.78 + */
    1.79  extern int SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic,
    1.80 -      struct haptic_effect * effect, SDL_HapticEffect * data);
    1.81 +                                      struct haptic_effect * effect,
    1.82 +                                      SDL_HapticEffect * data);
    1.83 +
    1.84 +/*
    1.85 + * Runs the effect on the haptic device.
    1.86 + *
    1.87 + * Returns 0 on success, -1 on error.
    1.88 + */
    1.89  extern int SDL_SYS_HapticRunEffect(SDL_Haptic * haptic,
    1.90 -      struct haptic_effect * effect);
    1.91 +                                   struct haptic_effect * effect);
    1.92 +
    1.93 +/*
    1.94 + * Stops the effect on the haptic device.
    1.95 + *
    1.96 + * Returns 0 on success, -1 on error.
    1.97 + */
    1.98  extern int SDL_SYS_HapticStopEffect(SDL_Haptic * haptic,
    1.99 -      struct haptic_effect * effect);
   1.100 +                                    struct haptic_effect * effect);
   1.101 +
   1.102 +/*
   1.103 + * Cleanups up the effect on the haptic device.
   1.104 + */
   1.105  extern void SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic,
   1.106 -      struct haptic_effect * effect);
   1.107 +                                        struct haptic_effect * effect);
   1.108 +
   1.109 +/*
   1.110 + * Sets the global gain of the haptic device.
   1.111 + *
   1.112 + * Returns 0 on success, -1 on error.
   1.113 + */
   1.114  extern int SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain);
   1.115 -extern int SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter);
   1.116 +
   1.117 +/*
   1.118 + * Sets the autocenter feature of the haptic device.
   1.119 + *
   1.120 + * Returns 0 on success, -1 on error.
   1.121 + */
   1.122 +extern int SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic,
   1.123 +                                       int autocenter);
   1.124  
   1.125