Mercurial > sdl-ios-xcode
comparison include/SDL_haptic.h @ 2477:97f75ea43a93 gsoc2008_force_feedback
Starting to add infrastructure to handle haptic effects.
author | Edgar Simo <bobbens@gmail.com> |
---|---|
date | Mon, 30 Jun 2008 16:48:16 +0000 |
parents | 242d8a668ebb |
children | 4fd783e0f34b |
comparison
equal
deleted
inserted
replaced
2476:242d8a668ebb | 2477:97f75ea43a93 |
---|---|
55 #define SDL_HAPTIC_RUMBLE (1<<6) | 55 #define SDL_HAPTIC_RUMBLE (1<<6) |
56 #define SDL_HAPTIC_INERTIA (1<<7) | 56 #define SDL_HAPTIC_INERTIA (1<<7) |
57 #define SDL_HAPTIC_GAIN (1<<8) | 57 #define SDL_HAPTIC_GAIN (1<<8) |
58 #define SDL_HAPTIC_AUTOCENTER (1<<9) | 58 #define SDL_HAPTIC_AUTOCENTER (1<<9) |
59 | 59 |
60 typedef struct SDL_HapticConstant { | |
61 /* Header */ | |
62 Uint16 type; | |
63 Uint16 length; | |
64 Uint16 delay; | |
65 Uint16 direction; | |
66 } SDL_HapticConstant; | |
67 | |
68 typedef union SDL_HapticEffect { | |
69 /* Common for all force feedback effects */ | |
70 Uint16 type; /* Effect type */ | |
71 SDL_HapticConstant constant; /* Constant effect */ | |
72 } SDL_HapticEffect; | |
73 | |
60 | 74 |
61 /* Function prototypes */ | 75 /* Function prototypes */ |
62 /* | 76 /* |
63 * Count the number of joysticks attached to the system | 77 * Count the number of joysticks attached to the system |
64 */ | 78 */ |
83 /* | 97 /* |
84 * Closes a Haptic device previously opened with SDL_HapticOpen. | 98 * Closes a Haptic device previously opened with SDL_HapticOpen. |
85 */ | 99 */ |
86 extern DECLSPEC void SDL_HapticClose(SDL_Haptic * haptic); | 100 extern DECLSPEC void SDL_HapticClose(SDL_Haptic * haptic); |
87 | 101 |
102 /* | |
103 * Creates a new haptic effect on the device. | |
104 */ | |
105 extern DECLSPEC int SDL_HapticNewEffect(SDL_Haptic * haptic, SDL_HapticEffect * effect); | |
106 | |
107 /* | |
108 * Runs the haptic effect on it's assosciated haptic device. | |
109 */ | |
110 extern DECLSPEC int SDL_HapticRunEffect(SDL_Haptic * haptic, int effect); | |
111 | |
112 /* | |
113 * Destroys a haptic effect on the device. | |
114 */ | |
115 extern DECLSPEC void SDL_HapticDestroyEffect(SDL_Haptic * haptic, int effect); | |
116 | |
88 | 117 |
89 /* Ends C function definitions when using C++ */ | 118 /* Ends C function definitions when using C++ */ |
90 #ifdef __cplusplus | 119 #ifdef __cplusplus |
91 /* *INDENT-OFF* */ | 120 /* *INDENT-OFF* */ |
92 } | 121 } |