forked from MoonsideGames/MoonWorks
				
			log controller open errors
							parent
							
								
									e9aacb44da
								
							
						
					
					
						commit
						86322e9373
					
				|  | @ -86,9 +86,18 @@ namespace MoonWorks.Input | ||||||
| 			for (var slot = 0; slot < MAX_GAMEPADS; slot += 1) | 			for (var slot = 0; slot < MAX_GAMEPADS; slot += 1) | ||||||
| 			{ | 			{ | ||||||
| 				if (!GamepadExists(slot)) | 				if (!GamepadExists(slot)) | ||||||
|  | 				{ | ||||||
|  | 					var openResult = SDL.SDL_GameControllerOpen(index); | ||||||
|  | 					if (openResult == 0) | ||||||
|  | 					{ | ||||||
|  | 						System.Console.WriteLine($"Error opening gamepad!"); | ||||||
|  | 						System.Console.WriteLine(SDL.SDL_GetError()); | ||||||
|  | 					} | ||||||
|  | 					else | ||||||
| 					{ | 					{ | ||||||
| 						gamepads[slot].Handle = SDL.SDL_GameControllerOpen(index); | 						gamepads[slot].Handle = SDL.SDL_GameControllerOpen(index); | ||||||
| 						System.Console.WriteLine($"Gamepad added to slot {slot}!"); | 						System.Console.WriteLine($"Gamepad added to slot {slot}!"); | ||||||
|  | 					} | ||||||
| 					return; | 					return; | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue