Merge pull request #568 from hitomi-nakayama/warn-sdl-init-error

Warn user about SDL initialization failure
This commit is contained in:
Lior Halphon 2025-06-02 23:40:54 +03:00 committed by GitHub
commit 63a02d90bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -1382,7 +1382,9 @@ int main(int argc, char **argv)
signal(SIGUSR1, debugger_reset);
#endif
SDL_Init(SDL_INIT_EVERYTHING & ~SDL_INIT_AUDIO);
if (SDL_Init(SDL_INIT_EVERYTHING & ~SDL_INIT_AUDIO) < 0) {
fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
}
// This is, essentially, best-effort.
// This function will not be called if the process is terminated in any way, anyhow.
atexit(SDL_Quit);