From 9a16aa7b253928b3f09592411b0c5a3a8b61b293 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sat, 28 Dec 2024 00:01:27 +0100 Subject: [PATCH] Show SDL error during initialization --- ISLE/isleapp.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ISLE/isleapp.cpp b/ISLE/isleapp.cpp index 8dc3b065..731aa6e1 100644 --- a/ISLE/isleapp.cpp +++ b/ISLE/isleapp.cpp @@ -232,12 +232,14 @@ SDL_AppResult SDL_AppInit(void** appstate, int argc, char** argv) *appstate = NULL; if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK)) { - SDL_ShowSimpleMessageBox( - SDL_MESSAGEBOX_ERROR, - "LEGO® Island Error", - "\"LEGO® Island\" failed to start. Please quit all other applications and try again.", - NULL + char buffer[256]; + SDL_snprintf( + buffer, + sizeof(buffer), + "\"LEGO® Island\" failed to start.\nPlease quit all other applications and try again.\nSDL error: %s", + SDL_GetError() ); + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "LEGO® Island Error", buffer, NULL); return SDL_APP_FAILURE; } @@ -263,7 +265,7 @@ SDL_AppResult SDL_AppInit(void** appstate, int argc, char** argv) SDL_ShowSimpleMessageBox( SDL_MESSAGEBOX_ERROR, "LEGO® Island Error", - "\"LEGO® Island\" failed to start. Please quit all other applications and try again.", + "\"LEGO® Island\" failed to start.\nPlease quit all other applications and try again.", g_isle->GetWindowHandle() ); return SDL_APP_FAILURE;