comparison include/SDL_haptic.h @ 2482:b51ad78812d5 gsoc2008_force_feedback

Removed the linux only SDL_HAPTIC_RUMBLE (use PERIODIC instead). Added and partially implemented CONDITION and RAMP effects.
author Edgar Simo <bobbens@gmail.com>
date Tue, 01 Jul 2008 11:21:36 +0000
parents 5d0ea4576f20
children 9d52368ebcf5
comparison
equal deleted inserted replaced
2481:5d0ea4576f20 2482:b51ad78812d5
50 #define SDL_HAPTIC_PERIODIC (1<<1) 50 #define SDL_HAPTIC_PERIODIC (1<<1)
51 #define SDL_HAPTIC_RAMP (1<<2) 51 #define SDL_HAPTIC_RAMP (1<<2)
52 #define SDL_HAPTIC_SPRING (1<<3) 52 #define SDL_HAPTIC_SPRING (1<<3)
53 #define SDL_HAPTIC_FRICTION (1<<4) 53 #define SDL_HAPTIC_FRICTION (1<<4)
54 #define SDL_HAPTIC_DAMPER (1<<5) 54 #define SDL_HAPTIC_DAMPER (1<<5)
55 #define SDL_HAPTIC_RUMBLE (1<<6) 55 #define SDL_HAPTIC_INERTIA (1<<6)
56 #define SDL_HAPTIC_INERTIA (1<<7) 56 #define SDL_HAPTIC_GAIN (1<<7)
57 #define SDL_HAPTIC_GAIN (1<<8) 57 #define SDL_HAPTIC_AUTOCENTER (1<<8)
58 #define SDL_HAPTIC_AUTOCENTER (1<<9)
59 58
60 typedef enum SDL_waveform { 59 typedef enum SDL_waveform {
61 SDL_WAVEFORM_SINE, 60 SDL_WAVEFORM_SINE,
62 SDL_WAVEFORM_SQUARE, 61 SDL_WAVEFORM_SQUARE,
63 SDL_WAVEFORM_TRIANGLE, 62 SDL_WAVEFORM_TRIANGLE,
132 Uint16 attack_length; 131 Uint16 attack_length;
133 Uint16 attack_level; 132 Uint16 attack_level;
134 Uint16 fade_length; 133 Uint16 fade_length;
135 Uint16 fade_level; 134 Uint16 fade_level;
136 } SDL_HapticPeriodic; 135 } SDL_HapticPeriodic;
136 typedef struct SDL_HapticCondition {
137 /* Header */
138 Uint16 type; /* SDL_HAPTIC_{SPRING,DAMPER,INERTIA,FRICTION} */
139 Uint16 direction;
140
141 /* Replay */
142 Uint16 length;
143 Uint16 delay;
144
145 /* Trigger */
146 Uint16 button;
147 Uint16 interval;
148
149 /* Condition */
150 Uint16 right_sat; /* Level when joystick is to the right. */
151 Uint16 left_sat; /* Level when joystick is to the left */
152 Sint16 right_coeff; /* How fast to increase the force towards the right */
153 Sint16 left_coeff; /* How fast to increase the force towards the left */
154 Uint16 deadband; /* Size of the dead zone */
155 Sint16 center; /* Position of the dead zone */
156
157 } SDL_HapticCondition;
158 typedef struct SDL_HapticRamp {
159 /* Header */
160 Uint16 type; /* SDL_HAPTIC_RAMP */
161 Uint16 direction;
162
163 /* Replay */
164 Uint16 length;
165 Uint16 delay;
166
167 /* Trigger */
168 Uint16 button;
169 Uint16 interval;
170
171 /* Ramp */
172 Sint16 start;
173 Sint16 end;
174
175 /* Envelope */
176 Uint16 attack_length;
177 Uint16 attack_level;
178 Uint16 fade_length;
179 Uint16 fade_level;
180
181 } SDL_HapticRamp;
137 182
138 typedef union SDL_HapticEffect { 183 typedef union SDL_HapticEffect {
139 /* Common for all force feedback effects */ 184 /* Common for all force feedback effects */
140 Uint16 type; /* Effect type */ 185 Uint16 type; /* Effect type */
141 SDL_HapticConstant constant; /* Constant effect */ 186 SDL_HapticConstant constant; /* Constant effect */
142 SDL_HapticPeriodic periodic; /* Periodic effect */ 187 SDL_HapticPeriodic periodic; /* Periodic effect */
188 SDL_HapticCondition condition; /* Condition effect */
189 SDL_HapticRamp ramp; /* Ramp effect */
143 } SDL_HapticEffect; 190 } SDL_HapticEffect;
144 191
145 192
146 /* Function prototypes */ 193 /* Function prototypes */
147 /* 194 /*