Stdout

Hi all,

I am using SDL on Windows XP.
When I use “printf”, the text is not printed
on the standard out but in a file called
stdout.txt. It is not a big problem but it is
boring to edit this file each time a run a
SDL program.
Do someone know how to avoid this ?

Thanks !

Guillaume

I present you a new tool called Google, it permits to find great
information on internet :

http://www.google.fr/search?sourceid=mozclient&ie=utf-8&oe=utf-8&q=site:www.libsdl.org+SDL+stdout.txt+stderr+.txt

Look at this :

http://www.libsdl.org/pipermail/sdl/2003-March/053296.html

What about putting this in the FAQ ?

Julien

I’m having some trouble understanding the values returned by SDL_ListModes.

When call SDL_ListModes(null, SDL_HWSURFACE), it returns a pointer value
of xFFFFFFFF

I understand that when null is returned, no video modes are supported.
However the docs state that -1 is returned when all modes are supported.

So is a pointer to an SDL_Rect returned that must be cast to -1 ? Or is
an interger -1 returned ? Or am I missing something ?

Thanks,
-Luke

You get the display modes supported from your system in window mode.
So, all resolutions are available.
0xffffffff == -1

I’m having some trouble understanding the values returned by
SDL_ListModes.>
When call SDL_ListModes(null, SDL_HWSURFACE), it returns a pointer value
of xFFFFFFFF

I understand that when null is returned, no video modes are supported.
However the docs state that -1 is returned when all modes are supported.

So is a pointer to an SDL_Rect returned that must be cast to -1 ? Or is
an interger -1 returned ? Or am I missing something ?

<- Chameleon -> wrote:

You get the display modes supported from your system in window mode.
So, all resolutions are available.

…again, in windowed mode. To get the actual resolutions available,
pass sdl_listmodes something like this:

modes = SDL_ListModes(NULL, _sdl_flags | SDL_FULLSCREEN);

Regards,
\Mikkel Gjoel

SDL redirects both stderr and stdout into file, because Windows does not
attach programs into console windows, and therefore you would never see
the output of printf() for example. The method I use to overcome this,
is a program called ‘tail’. It’s a standard *nix program, and available
as a native Win32 port in UnxUtils package
(http://unxutils.sourceforge.net/). You just have to open a console
window and chdir to the folder in which your project resides and type
"tail -f stderr.txt stdout.txt". All output gets nicely printed in the
console window. I guess it’s not the fastest solution, but it works well
enough for debugging purposes.

Regards,
Anders

Guillaume wrote:> Hi all,

I am using SDL on Windows XP.
When I use “printf”, the text is not printed
on the standard out but in a file called
stdout.txt. It is not a big problem but it is
boring to edit this file each time a run a
SDL program.
Do someone know how to avoid this ?

Thanks !

Guillaume

I can’t say for the MS compilers, but with mingw/msys I usually compile
without the stdio redirect. This gives me the expected stdio output when I
compile the project for the console and when I compile for the win32 gui
then the output is ignored. It is pretty much good all the way around, no
dos box when compiled for windows, but I can still get the dos box by
changing one linker switch. :}> ----- Original Message -----

From: sdl-admin@libsdl.org [mailto:sdl-admin at libsdl.org] On Behalf Of Anders
Fr?berg
Sent: Tuesday, January 27, 2004 1:27 AM
To: sdl at libsdl.org
Subject: [SDL] Re: stdout

SDL redirects both stderr and stdout into file, because Windows does not
attach programs into console windows, and therefore you would never see
the output of printf() for example. The method I use to overcome this,
is a program called ‘tail’. It’s a standard *nix program, and available
as a native Win32 port in UnxUtils package
(http://unxutils.sourceforge.net/). You just have to open a console
window and chdir to the folder in which your project resides and type
"tail -f stderr.txt stdout.txt". All output gets nicely printed in the
console window. I guess it’s not the fastest solution, but it works well
enough for debugging purposes.

Regards,
Anders

Guillaume wrote:

Hi all,

I am using SDL on Windows XP.
When I use “printf”, the text is not printed
on the standard out but in a file called
stdout.txt. It is not a big problem but it is
boring to edit this file each time a run a
SDL program.
Do someone know how to avoid this ?

Thanks !

Guillaume


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

in visualc++ 6.0 it works like this:

create a new project either as

windows application -> printf() goes into the files
windows console applicatiosn -> printf() goes into a console in the
background.

don’t forget to set the sdl specific stuff, see VisualC.html that comes
with SDL for further information.

they should put that in the visualc.html!