Print stick GUID in testjoystick.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 11 Dec 2012 11:59:29 -0500
changeset 6733 cfef740efada
parent 6732 b4201930fb9f
child 6734 7fdaee2be782
Print stick GUID in testjoystick.
test/testjoystick.c
--- a/test/testjoystick.c	Tue Dec 11 11:41:06 2012 -0500
+++ b/test/testjoystick.c	Tue Dec 11 11:59:29 2012 -0500
@@ -219,11 +219,15 @@
             fprintf(stderr, "SDL_JoystickOpen(%d) failed: %s\n", i,
                     SDL_GetError());
         } else {
+            JoystickGUID guid = SDL_JoystickGetGUID(joystick);
+            char *guidstr = SDL_JoystickGetGUIDString(guid);
             printf("       axes: %d\n", SDL_JoystickNumAxes(joystick));
             printf("      balls: %d\n", SDL_JoystickNumBalls(joystick));
             printf("       hats: %d\n", SDL_JoystickNumHats(joystick));
             printf("    buttons: %d\n", SDL_JoystickNumButtons(joystick));
             printf("instance id: %d\n", SDL_JoystickInstanceID(joystick));
+            printf("       guid: %s\n", guidstr);
+            SDL_free(guidstr);
             SDL_JoystickClose(joystick);
         }
     }