The SDL error message is now printed to the log if a controller could not be added

This commit is contained in:
Leon Styhre 2023-12-23 10:57:34 +01:00
parent 573b0859e1
commit 5fcf2ea49a

View file

@ -635,7 +635,8 @@ void InputManager::addControllerByDeviceIndex(Window* window, int deviceIndex)
SDL_GameController* controller {SDL_GameControllerOpen(deviceIndex)};
if (controller == nullptr) {
LOG(LogError) << "Couldn't add controller with device index " << deviceIndex;
LOG(LogError) << "Couldn't add controller with device index " << deviceIndex << " ("
<< SDL_GetError() << ")";
return;
}