소스 검색

testcontroller: log the ID of gamepads as they are added and removed

Sam Lantinga 3 달 전
부모
커밋
b524af1b43
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      test/testcontroller.c

+ 2 - 0
test/testcontroller.c

@@ -1019,6 +1019,7 @@ static void HandleGamepadAdded(SDL_JoystickID id, bool verbose)
     if (i < 0) {
         return;
     }
+    SDL_Log("Gamepad %u added\n", id);
 
     SDL_assert(!controllers[i].gamepad);
     controllers[i].gamepad = SDL_OpenGamepad(id);
@@ -1090,6 +1091,7 @@ static void HandleGamepadRemoved(SDL_JoystickID id)
     if (i < 0) {
         return;
     }
+    SDL_Log("Gamepad %u removed\n", id);
 
     if (controllers[i].mapping) {
         SDL_free(controllers[i].mapping);