src/haptic/SDL_haptic.c
branchgsoc2008_force_feedback
changeset 2506 ba8e99fe92c1
parent 2505 abfcba0f3bd1
child 2507 8ef1d0f4d0c1
     1.1 --- a/src/haptic/SDL_haptic.c	Tue Jul 08 19:23:03 2008 +0000
     1.2 +++ b/src/haptic/SDL_haptic.c	Tue Jul 08 19:35:10 2008 +0000
     1.3 @@ -149,6 +149,25 @@
     1.4  
     1.5  
     1.6  /*
     1.7 + * Returns 1 if the device has been opened.
     1.8 + */
     1.9 +int
    1.10 +SDL_HapticOpened(int device_index)
    1.11 +{
    1.12 +   int i, opened;
    1.13 +
    1.14 +   opened = 0;
    1.15 +   for (i=0; SDL_haptics[i]; i++) {
    1.16 +      if (SDL_haptics[i]->index == (Uint8) device_index) {
    1.17 +         opened = 1;
    1.18 +         break;
    1.19 +      }
    1.20 +   }
    1.21 +   return opened;
    1.22 +}
    1.23 +
    1.24 +
    1.25 +/*
    1.26   * Returns the index to a haptic device.
    1.27   */
    1.28  int