comparison src/haptic/SDL_haptic.c @ 2506:ba8e99fe92c1 gsoc2008_force_feedback

Added SDL_HapticOpened().
author Edgar Simo <bobbens@gmail.com>
date Tue, 08 Jul 2008 19:35:10 +0000
parents abfcba0f3bd1
children 8ef1d0f4d0c1
comparison
equal deleted inserted replaced
2505:abfcba0f3bd1 2506:ba8e99fe92c1
147 return haptic; 147 return haptic;
148 } 148 }
149 149
150 150
151 /* 151 /*
152 * Returns 1 if the device has been opened.
153 */
154 int
155 SDL_HapticOpened(int device_index)
156 {
157 int i, opened;
158
159 opened = 0;
160 for (i=0; SDL_haptics[i]; i++) {
161 if (SDL_haptics[i]->index == (Uint8) device_index) {
162 opened = 1;
163 break;
164 }
165 }
166 return opened;
167 }
168
169
170 /*
152 * Returns the index to a haptic device. 171 * Returns the index to a haptic device.
153 */ 172 */
154 int 173 int
155 SDL_HapticIndex(SDL_Haptic * haptic) 174 SDL_HapticIndex(SDL_Haptic * haptic)
156 { 175 {