What to do when init fails?

This is more like sugestion than question.

My problem is this: when SDL_Init() or SDL_SetVideoMode() fails, there is no way to
notify user about this on a system-independent way (since nothing can be printed
to the screen). On Windows, stderr is redirected to file, so I cant even use that metod,
and I dont know what is situation about stderr on otner systems.

Maybe I am missing some way to do this properly?

How about a function like SDL_OutputFatalError(char* errText) that would
display a message box where it is possible, otherwise print to stderr?

Another sugestion is that function like GetOpenFileName() would be nice for writing cross-platform applications.

I like SDL becouse of its simplicity, and there is a new version 1.3 comming,
so can I just suggest to keep it simple.

How about a function like SDL_OutputFatalError(char* errText) that would
display a message box where it is possible, otherwise print to stderr?

Now that I’m thinking about this, SDL already DOES have the infrastructure
to best determine how to get a platform-specific message box to the screen
(and when to use stderr). Choosing what to do to get a message to the
screen is half solved by simply placing the code with specific video
drivers.

Perhaps it’s worth adding this to the video subsystem?

–ryan.

Hello!

Now that I’m thinking about this, SDL already DOES have the
infrastructure to best determine how to get a platform-specific
message box to the screen (and when to use stderr).

It could have a hard time showing some message box when
SDL_Init() or SDL_SetVideoMode() just have failed…

Ciao,
Eike

It could have a hard time showing some message box when
SDL_Init() or SDL_SetVideoMode() just have failed…

True, but it’s in a better position to know if fprintf(stderr, …) is
effective, or if DirectX failed, but standard win32 msgbox apis are
available, etc, or if beeping the internal speaker is an option, etc.

This is true for all platforms; they all have workarounds and solutions
unique to them. I’m just suggesting that the SDL codebase has insight onto
the best solution for getting a “everything’s screwed” message to the
user.

–ryan.