Pārlūkot izejas kodu

Allow testing a specific controller

Sam Lantinga 4 gadi atpakaļ
vecāks
revīzija
04b45b5581
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  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! */