From b56be5934401e5828f5f648b18b58abbea4ae884 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Fri, 2 Jun 2023 14:11:47 -0500 Subject: [PATCH] GUI: check SDL_Init status --- src/gui/gui.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 106685af7..bb806dcd4 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -6021,7 +6021,14 @@ bool FurnaceGUI::init() { #endif // initialize SDL - SDL_Init(SDL_INIT_VIDEO|SDL_INIT_HAPTIC); + if (SDL_Init(SDL_INIT_VIDEO)!=0) { + logE("could not initialize video! %s",SDL_GetError()); + return false; + } + + if (SDL_Init(SDL_INIT_HAPTIC)!=0) { + logW("could not initialize haptic! %s",SDL_GetError()); + } const char* videoBackend=SDL_GetCurrentVideoDriver(); if (videoBackend!=NULL) {