Sign in to follow this  
homeboye

[SDL] how to show output to the console window?

Recommended Posts

homeboye    115
Hello, how would I change the output from 'stdout' to the console window in win32? EDIT: without using any windows-specific headers/commands/functions. EDIT2: better yet, ppl that have recompiled the SDLmain.a, can you send me the file? ;) [Edited by - homeboye on March 11, 2006 10:08:48 AM]

Share this post


Link to post
Share on other sites
evillive2    779
If you are using a version of MS Visual C you would create a console project instead of a win32 project and this sets the right IDE/environment variables where stdout is the console window. Using DevC++ I used the SDL DevPack and the project template it provides and that is the default. I am unsure exactly how to do it manually but I know it is a few settings you can change to your project in your IDE that affect this behavior. I am sure there are examples somewhere for whatever IDE you are using if you look a little bit.

Share this post


Link to post
Share on other sites
Malchivus    100
SDL 1.2.9 began redirected stdout, and stdin. People must have been complaining about the presence of a console in their applications. You can either re-set the redirecting (ie cancel it out) which is what the "freopen" does. Alternatively you can rebuild SDL so that redirection is disabled .

I prefer the later myself, i believe there is a line in "sdl_win.c[pp]" about WindowsCE (for whic redirection was unsuitable) but I'm not sure, although I remember it being realy obvious what was going on.

[Edited by - Malchivus on March 17, 2006 10:50:59 AM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this