Browse Source

Allow testing a specific controller

Sam Lantinga 4 years ago
parent
commit
04b45b5581
1 changed files with 4 additions and 0 deletions
  1. 4 0
      test/testgamecontroller.c

+ 4 - 0
test/testgamecontroller.c

@@ -448,6 +448,10 @@ main(int argc, char *argv[])
     /* !!! FIXME: */
     /*SDL_RenderSetLogicalSize(screen, background->w, background->h);*/
 
+    if (argv[1] && *argv[1] != '-') {
+        gamecontroller = SDL_GameControllerOpen(SDL_atoi(argv[1]));
+    }
+
     UpdateWindowTitle();
 
     /* Loop, getting controller events! */