Message Box

Hello,

I have searched SDL and haven’t found something like MessageBox() function.
Is something like this possible with SDL, or must I make my own?

I want MessageBox() for Windows, Linux and Mac. And I don’t know how to make
it under Linux and Mac.

Thanks,
Marek

Message boxes suck: they involve a focus shift and interrupt the flow
of a program to be dismissed. (and can sometimes come up BEHIND the
window they are associated with, making it almost impossible to
dismiss them or to know they are there)

Please use another method of reporting messages to the user, such as a
status area. Most games employ a neat way of alerting the user
something is wrong and giving them the oportunity to find out more by
clicking a button or pushing a key. (ie: the wireframe rectangles in
Starcraft or the cries for help from [computer] teammates in Unreal
Tournament)–

Olivier A. Dagenais - Software Architect and Developer

“Marek Rosa” wrote in message
news:NDBBJANKBKHJLHBCACACMEPMDIAA.marekrosa at stonline.sk

Hello,

I have searched SDL and haven’t found something like MessageBox()
function.
Is something like this possible with SDL, or must I make my own?

I want MessageBox() for Windows, Linux and Mac. And I don’t know how
to make
it under Linux and Mac.

Thanks,
Marek

I don’t need to use MessageBox for showing something about game play during
game.
I only need it to show, that some error occured. Something like this:

“Error occured. Look log file.” and app will quit. Thats all.

Marek> ----- Original Message -----

From: owner-sdl@lokigames.com [mailto:owner-sdl at lokigames.com]On Behalf
Of Olivier Dagenais
Sent: Tuesday, July 17, 2001 12:58 AM
To: sdl at lokigames.com
Subject: [SDL] Re: Message Box

Message boxes suck: they involve a focus shift and interrupt the flow
of a program to be dismissed. (and can sometimes come up BEHIND the
window they are associated with, making it almost impossible to
dismiss them or to know they are there)

Please use another method of reporting messages to the user, such as a
status area. Most games employ a neat way of alerting the user
something is wrong and giving them the oportunity to find out more by
clicking a button or pushing a key. (ie: the wireframe rectangles in
Starcraft or the cries for help from [computer] teammates in Unreal
Tournament)

Olivier A. Dagenais - Software Architect and Developer

“Marek Rosa” <@Marek_Rosa> wrote in message
news:NDBBJANKBKHJLHBCACACMEPMDIAA.@Marek_Rosa

Hello,

I have searched SDL and haven’t found something like MessageBox()
function.
Is something like this possible with SDL, or must I make my own?

I want MessageBox() for Windows, Linux and Mac. And I don’t know how
to make
it under Linux and Mac.

Thanks,
Marek

i don’t really konw OS specific code to popup a message box. But
what about popping a SDL windows with the message ?

i plan to write (at last for windows) a way to create SDL window as
ordinary component.
I begin to look at the code and discover you use some global
variable, including “extern HWND SDL_Window”.

This a big problem for such a goal.
i wonder if, for SDL 1.3 you plan to get rid of these global variables ?
will it happen soon ?

Something like this is really beyond what the core SDL was designed for
(recall the “S” in SDL stands for “Simple” ;-).

If you really want a premade solution for this, I would recommend taking a
look at some of the add-on libraries at:
http://www.libsdl.org/libraries.html

Bear in mind that a lot of the other platforms you originally mentionned you
wanted to support usually don’t have message boxes like this for their
applications. Also bear in mind that the various Unix platforms usually have
several window managers to choose from, so in order to make something truely
platform independent, you should probably avoid using window manager specific
code.On Tuesday 17 July 2001 08:40am, Marek Rosa wrote:

I don’t need to use MessageBox for showing something about game play during
game.
I only need it to show, that some error occured. Something like this:

“Error occured. Look log file.” and app will quit. Thats all.


Sam “Criswell” Hart <@Sam_Hart> AIM, Yahoo!:
Homepage: < http://www.geekcomix.com/snh/ >
PGP Info: < http://www.geekcomix.com/snh/contact/ >
Advogato: < http://advogato.org/person/criswell/ >

“Olivier Dagenais” <olivier.dagenais at canada.com> wrote

Please use another method of reporting messages to the user, such as a
status area. Most games employ a neat way of alerting the user
something is wrong and giving them the oportunity to find out more by
clicking a button or pushing a key. (ie: the wireframe rectangles in
Starcraft or the cries for help from [computer] teammates in Unreal
Tournament)

of course, other times you get an error trying to initialize
your game. or some sort of fatal error occurs that requires
the game to be immediately terminated. if you just "printf"
on windows your game errors silently.

to end users this looks like nothing happens when they
doubleclick the icon for your game. “what’s the deal, nothing
happens”. on the other hand, if they got a message box saying
something like “Could not initialize directx”, you are much
better off.

Please use another method of reporting messages to the user, such
as a

status area.
of course, other times you get an error trying to initialize
your game. or some sort of fatal error occurs that requires
the game to be immediately terminated. if you just "printf"
on windows your game errors silently.

I’m willing to bet most conditions that would normally cause a fatal
error can be detected and reported in a nice way to the user, even if
it is just calling SDL_LoadBMP with a standard “an error occurred,
please check stderr” bitmap and throwing it on the screen, before
exiting to the operating system. You can also provide a “debug” or
"safe mode" version of the game that is linked to be a console program
(for Windows) and so you can then see the error message(s) right away.

That, or you ship a little program with your SDL program that
interprets the return codes and reports them in such a way that the
user can do something about it. I’m willing to bet such a "launcher"
could be a re-usable program that could be used with many SDL apps,
especially if it is able to detect common problems such as directx not
being installed or a corrupt OpenGL driver of some sort or whatnot.
(ie: something like “dxdiag”, that allows you to see what features are
hardware accelerated and to test them out)–

Olivier A. Dagenais - Software Architect and Developer