Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Disable SFML Console Outputting  (Read 5737 times)

0 Members and 1 Guest are viewing this topic.

coolhome

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Disable SFML Console Outputting
« 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
CoderZilla - Everything Programming

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Disable SFML Console Outputting
« Reply #1 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);
Laurent Gomila - SFML developer

Mr. X

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
Disable SFML Console Outputting
« Reply #2 on: December 26, 2009, 06:05:18 pm »
If you are using Visual Studio just set the Subsystem to Windows. The Console will disappear.

coolhome

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Disable SFML Console Outputting
« Reply #3 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
CoderZilla - Everything Programming

jmp

  • Newbie
  • *
  • Posts: 3
    • View Profile
Disable SFML Console Outputting
« Reply #4 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Disable SFML Console Outputting
« Reply #5 on: February 08, 2010, 01:39:49 pm »
It makes sense, yes. I was already thinking about doing that in SFML 2 ;)
Laurent Gomila - SFML developer

 

anything