Commit 04b45b5581d72225a30a9dd4965d1dceec7ce5a1

Sam Lantinga 2020-11-23T14:28:30

Allow testing a specific controller

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/test/testgamecontroller.c b/test/testgamecontroller.c
index cf5eaf7..7f3af1e 100644
--- a/test/testgamecontroller.c
+++ b/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! */