Error Message Output

Hmm, another feature request to consider:

a function:
void print_message( Uint8 *string )
would create a new dialog box and display the string along with an "OK"
button. Mostly for windows where there is no command line to use printf
with.

Hmm, another feature request to consider:

a function:
void print_message( Uint8 *string )
would create a new dialog box and display the string along with an "OK"
button. Mostly for windows where there is no command line to use printf
with.

Yeah, this is an ugly point in SDL. There’s no really elegant way to output
messages. stderr.txt just isn’t usable. What I would like to do is to
create some sort of general routines that can override fprintf and redirect
the output to either a file or a scrolling window, or something useful.
I really don’t know what to do for fullscreen displays.

sigh Any help in this area is GREATLY appreciated. :slight_smile:

Maybe an internal scrolling text box that could be modified and displayed
would be useful?
Any suggestions on a font?

See ya!
-Sam Lantinga (slouken at devolution.com)–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

Le Sun, 11 Oct 1998, vous avez ?crit :

Hmm, another feature request to consider:

a function:
void print_message( Uint8 *string )
would create a new dialog box and display the string along with an "OK"
button. Mostly for windows where there is no command line to use printf
with.

Yeah, this is an ugly point in SDL. There’s no really elegant way to output
messages. stderr.txt just isn’t usable. What I would like to do is to
create some sort of general routines that can override fprintf and redirect
the output to either a file or a scrolling window, or something useful.
I really don’t know what to do for fullscreen displays.

sigh Any help in this area is GREATLY appreciated. :slight_smile:

Maybe an internal scrolling text box that could be modified and displayed
would be useful?
Any suggestions on a font?

Why not making an emergency dialog box, like a box using a red rectangle over
it ?
For the text we should make some standard Font, I don’t know what is the best
between homemade TTF and mapped font. ( I mean, 8x8 dots matrix directly into a
…h file ) I don’t think using Freetype for that is good, because we must keep
this little. What others people think abotu this idea ? I’m ready to do this
8x8 dots font

See ya!
-Sam Lantinga (slouken at devolution.com)


Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

Stephane Magnenat
Stephane.magnenat at urbanet.ch

fprintf(stderr, string, …);

I heard something about the stderr being written to stderr.txt under 'doze.On Sun, Oct 11, 1998 at 08:42:27AM -0400, emblem wrote:

Hmm, another feature request to consider:

a function:
void print_message( Uint8 *string )
would create a new dialog box and display the string along with an "OK"
button. Mostly for windows where there is no command line to use printf
with.


– Michael Samuel

Maybe an internal scrolling text box that could be modified and displayed
would be useful?

Would it? What if I want to print the error “Cannot init video display\n”?

stderr.txt is very nifty, as it doesn’t scare the user, but is just a double
click away from being read out to tech support. If a commercial app needs it,
they can create a link in the start menu to stderr.txt in the correct directory
for easy finding by the user.On Sun, Oct 11, 1998 at 09:57:11AM -0700, Sam Lantinga wrote:


– Michael Samuel

Yeah, this is an ugly point in SDL. There’s no really elegant way to output
messages. stderr.txt just isn’t usable. What I would like to do is to
create some sort of general routines that can override fprintf and redirect
the output to either a file or a scrolling window, or something useful.
I really don’t know what to do for fullscreen displays.

Well, I don’t see why you couldn’t do that. stderr is just a file
pointer that can be opened, closed, and re-directed like any FILE * (If
my programming book isn’t lying to me). A freopen(), should allow you
to re-point stderr to any FILE * you want. The scrollable window (a la
Quake I imagine) would be more of a pain, but would be doable as well.
But alas it would take me ENTIRELY too much time to write the code to do
that. I’ll work on it, though, if no one else wants it.

But for my money, the easiest thing would to be to make an external
FILE *logfile, open it when the program begins, then
fprintf(logfile,“msg”) durring the program, and close it at the end.
It wouldn’t require any modification to SDL, and can be used at any
time.

Maybe an internal scrolling text box that could be modified and displayed
would be useful?

Yes, it would be. I’ll probably be using something like this for
player chatter in a chess-like and Othello-like game I’m planning. But
if you did it, I’d like to see it completely customizable (Mine would
probably be transparent).

Any suggestions on a font?

Would it be necessary to use a fixed font? Or would you be able to use
freetype to implement different fonts? If so, I vote for just a
generic, readable font like Ariel or something similar.On 11 Oct, Sam Lantinga wrote:


| |/ | | | _ | | | mailto:@Knight_Walker |
| / | / / | | http://www.aros.net/~kwalker |
| \ | ___ | | |
| |\ | | / \ | | The Kobran Imperium (801)265-1299 |
|| || || || _____________________________________/

Le Mon, 12 Oct 1998, vous avez ?crit :

Yeah, this is an ugly point in SDL. There’s no really elegant way to output
messages. stderr.txt just isn’t usable. What I would like to do is to
create some sort of general routines that can override fprintf and redirect
the output to either a file or a scrolling window, or something useful.
I really don’t know what to do for fullscreen displays.

Well, I don’t see why you couldn’t do that. stderr is just a file
pointer that can be opened, closed, and re-directed like any FILE * (If
my programming book isn’t lying to me). A freopen(), should allow you
to re-point stderr to any FILE * you want. The scrollable window (a la
Quake I imagine) would be more of a pain, but would be doable as well.
But alas it would take me ENTIRELY too much time to write the code to do
that. I’ll work on it, though, if no one else wants it.

But for my money, the easiest thing would to be to make an external
FILE *logfile, open it when the program begins, then
fprintf(logfile,“msg”) durring the program, and close it at the end.
It wouldn’t require any modification to SDL, and can be used at any
time.

Maybe an internal scrolling text box that could be modified and displayed
would be useful?

Yes, it would be. I’ll probably be using something like this for
player chatter in a chess-like and Othello-like game I’m planning. But
if you did it, I’d like to see it completely customizable (Mine would
probably be transparent).

Hello, I need soem widgets for SDL too, maybe could we work together for the
widget ?

Any suggestions on a font?

Would it be necessary to use a fixed font? Or would you be able to use
freetype to implement different fonts? If so, I vote for just a
generic, readable font like Ariel or something similar.

I think we at least souhd but a font into SDL code, just to enable tohe
prograsm to display some text. For more font, let the programmer use freetype.>On 11 Oct, Sam Lantinga wrote:


| |/ | | | _ | | | mailto:kwalker at aros.net |
| / | / / | | http://www.aros.net/~kwalker |
| \ | ___ | | |
| |\ | | / \ | | The Kobran Imperium (801)265-1299 |
|| || || || _____________________________________/

Stephane Magnenat
Stephane.magnenat at urbanet.ch

I wrote my own library (called SCL) and had the same problem. I used the
following solution:

A printf-like funktion prints into a memory buffer. After the program
exits, the debug-build will print all messages to the screen in the most
simple way for the given OS, that is a MessageBox under MS-Windows and
stdout for Dos, Unix and Playstation. The output is simple to redirect (I
suggest a callback-function for SDL), so it is no trouble to put it on the
screen if your application really needs it, or if you want to ease
debugging. I also plan to check for a Hercules Monochrome Adapter running
parallel to the VGA card, and use it for instant output if available, but I
got my Hercules only a week ago (hard to get these old things nowadays).

There is absolutely nothing difficult about the implementation, shuld be
less then 50 lines of code without hercules support, most of it for the
self-growing array that stores the text. It would be useless to give you my
implementation because it is based on SCL’s streaming and container
classes, but I plan to make a really nice hercules console with
hardware-scrolling, which should be easy to integrate into SDL.

Dierk Ohlerich
@Dierk_Ohlerich