test/testhaptic.c
changeset 7621 5caa5fb3deb6
parent 7517 965d57022c01
child 7629 a0a3bd77cbc4
     1.1 --- a/test/testhaptic.c	Sat Aug 10 13:20:45 2013 -0400
     1.2 +++ b/test/testhaptic.c	Sat Aug 10 13:38:09 2013 -0400
     1.3 @@ -213,6 +213,22 @@
     1.4          nefx++;
     1.5      }
     1.6  
     1.7 +    /* First we'll try a SINE effect. */
     1.8 +    if (supported & SDL_HAPTIC_LEFTRIGHT) {
     1.9 +        printf("   effect %d: Left/Right\n", nefx);
    1.10 +        efx[nefx].type = SDL_HAPTIC_LEFTRIGHT;
    1.11 +        efx[nefx].leftright.length = 5000;
    1.12 +        efx[nefx].leftright.large_magnitude = 0x3000;
    1.13 +        efx[nefx].leftright.small_magnitude = 0xFFFF;
    1.14 +        id[nefx] = SDL_HapticNewEffect(haptic, &efx[nefx]);
    1.15 +        if (id[nefx] < 0) {
    1.16 +            printf("UPLOADING EFFECT ERROR: %s\n", SDL_GetError());
    1.17 +            abort_execution();
    1.18 +        }
    1.19 +        nefx++;
    1.20 +    }
    1.21 +
    1.22 +
    1.23      printf
    1.24          ("\nNow playing effects for 5 seconds each with 1 second delay between\n");
    1.25      for (i = 0; i < nefx; i++) {
    1.26 @@ -260,8 +276,9 @@
    1.27          printf("      constant\n");
    1.28      if (supported & SDL_HAPTIC_SINE)
    1.29          printf("      sine\n");
    1.30 -    if (supported & SDL_HAPTIC_SQUARE)
    1.31 -        printf("      square\n");
    1.32 +    /* !!! FIXME: put this back when we have more bits in 2.1 */
    1.33 +    /*if (supported & SDL_HAPTIC_SQUARE)
    1.34 +        printf("      square\n");*/
    1.35      if (supported & SDL_HAPTIC_TRIANGLE)
    1.36          printf("      triangle\n");
    1.37      if (supported & SDL_HAPTIC_SAWTOOTHUP)
    1.38 @@ -280,6 +297,8 @@
    1.39          printf("      intertia\n");
    1.40      if (supported & SDL_HAPTIC_CUSTOM)
    1.41          printf("      custom\n");
    1.42 +    if (supported & SDL_HAPTIC_LEFTRIGHT)
    1.43 +        printf("      left/right\n");
    1.44      printf("   Supported capabilities:\n");
    1.45      if (supported & SDL_HAPTIC_GAIN)
    1.46          printf("      gain\n");