SFML community forums

General => Feature requests => Topic started by: coolhome on December 26, 2009, 04:18:57 am

Title: Disable SFML Console Outputting
Post by: coolhome on December 26, 2009, 04:18:57 am
The title basically says it. I think this would be cool to have. If this is an option already please tell me because somehow I missed it big time.

Thanks,
Preston
Title: Disable SFML Console Outputting
Post by: Laurent on December 26, 2009, 10:22:32 am
SFML outputs to std::cerr, and any standard stream can be redirected to whatever you want: a file, nothing, etc.

You can try this:
Code: [Select]
std::cerr.rdbuf(NULL);
Title: Disable SFML Console Outputting
Post by: Mr. X on December 26, 2009, 06:05:18 pm
If you are using Visual Studio just set the Subsystem to Windows. The Console will disappear.
Title: Disable SFML Console Outputting
Post by: coolhome on December 26, 2009, 06:38:12 pm
Quote from: "Laurent"
SFML outputs to std::cerr, and any standard stream can be redirected to whatever you want: a file, nothing, etc.

You can try this:
Code: [Select]
std::cerr.rdbuf(NULL);

Thanks! That works I didn't even see it used the error stream.

Quote from: "Mr. X"
If you are using Visual Studio just set the Subsystem to Windows. The Console will disappear.

But I want the console :P
Title: Disable SFML Console Outputting
Post by: jmp on February 08, 2010, 01:34:05 pm
Quote from: "Laurent"
SFML outputs to std::cerr, and any standard stream can be redirected to whatever you want: a file, nothing, etc.

Would it make sense for SFML should write its errors to its own error stream rather than std::cerr in the future?  The problem with redirecting std::cerr is that it also redirects everything else sent to that stream (e.g. the errors my program prints, or really anything that uses std::cerr) even if I only want to redirect SFML’s errors.

Anyway, just a suggestion.
Title: Disable SFML Console Outputting
Post by: Laurent on February 08, 2010, 01:39:49 pm
It makes sense, yes. I was already thinking about doing that in SFML 2 ;)