Fix error message when SDL fails to initialize (#861)

This commit is contained in:
Chris Purnell 2023-06-16 18:57:27 +01:00 committed by GitHub
parent 633e5c0e05
commit f6a1cc598e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,7 @@ SDLControllerProvider::SDLControllerProvider()
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_LUNA, "1");
if (SDL_Init(SDL_INIT_JOYSTICK | SDL_INIT_GAMECONTROLLER | SDL_INIT_HAPTIC | SDL_INIT_EVENTS) < 0)
throw std::runtime_error(fmt::format("couldn't initialize SDL: %s", SDL_GetError()));
throw std::runtime_error(fmt::format("couldn't initialize SDL: {}", SDL_GetError()));
if (SDL_GameControllerEventState(SDL_ENABLE) < 0) {