mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-02-03 12:31:15 +00:00
Show SDL error during initialization
This commit is contained in:
parent
643397299a
commit
9a16aa7b25
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user