summaryrefslogtreecommitdiff
path: root/test/testgamecontroller.c
diff options
context:
space:
mode:
authorSam Lantinga <slouken@libsdl.org>2020-11-23 14:28:30 -0800
committerSam Lantinga <slouken@libsdl.org>2020-11-23 14:28:30 -0800
commit48b80708f2ba41738f269dbb03240f09b5871183 (patch)
tree97819b5d06c49d04c83c3ccaaa68cf21d8c63ba2 /test/testgamecontroller.c
parent5fd01cc31060d46aee910553a8067f41a45d9f1c (diff)
downloadsdl-48b80708f2ba41738f269dbb03240f09b5871183.tar.gz
Allow testing a specific controller
Diffstat (limited to 'test/testgamecontroller.c')
-rw-r--r--test/testgamecontroller.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/testgamecontroller.c b/test/testgamecontroller.c
index cf5eaf734..7f3af1e29 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! */