mirror of
				https://github.com/libsdl-org/SDL.git
				synced 2025-10-26 12:27:44 +00:00 
			
		
		
		
	testcontroller: log the ID of gamepads as they are added and removed
This commit is contained in:
		| @@ -1019,6 +1019,7 @@ static void HandleGamepadAdded(SDL_JoystickID id, bool verbose) | |||||||
|     if (i < 0) { |     if (i < 0) { | ||||||
|         return; |         return; | ||||||
|     } |     } | ||||||
|  |     SDL_Log("Gamepad %u added\n", id); | ||||||
|  |  | ||||||
|     SDL_assert(!controllers[i].gamepad); |     SDL_assert(!controllers[i].gamepad); | ||||||
|     controllers[i].gamepad = SDL_OpenGamepad(id); |     controllers[i].gamepad = SDL_OpenGamepad(id); | ||||||
| @@ -1090,6 +1091,7 @@ static void HandleGamepadRemoved(SDL_JoystickID id) | |||||||
|     if (i < 0) { |     if (i < 0) { | ||||||
|         return; |         return; | ||||||
|     } |     } | ||||||
|  |     SDL_Log("Gamepad %u removed\n", id); | ||||||
|  |  | ||||||
|     if (controllers[i].mapping) { |     if (controllers[i].mapping) { | ||||||
|         SDL_free(controllers[i].mapping); |         SDL_free(controllers[i].mapping); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Sam Lantinga
					Sam Lantinga