sdl: Exit if SDL fails to create software renderer (#6430)

This commit is contained in:
rinsuki 2023-04-21 18:08:12 +09:00 committed by GitHub
parent 26d6f9d1c6
commit 3dd6557332
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -37,6 +37,11 @@ EmuWindow_SDL2_SW::EmuWindow_SDL2_SW(bool fullscreen, bool is_secondary)
window_surface = SDL_GetWindowSurface(render_window); window_surface = SDL_GetWindowSurface(render_window);
renderer = SDL_CreateSoftwareRenderer(window_surface); renderer = SDL_CreateSoftwareRenderer(window_surface);
if (renderer == nullptr) {
LOG_CRITICAL(Frontend, "Failed to create SDL2 software renderer: {}", SDL_GetError());
exit(1);
}
if (fullscreen) { if (fullscreen) {
Fullscreen(); Fullscreen();
} }