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

Author Topic: [SFML 2.0] Disabling error message  (Read 2991 times)

0 Members and 1 Guest are viewing this topic.

Hindi

  • Newbie
  • *
  • Posts: 20
    • View Profile
[SFML 2.0] Disabling error message
« on: March 18, 2013, 10:26:51 pm »
Hi !

I'm spamming the loadFromFile method on several directories. I'd like to keep my shell clean and set my own error messages instead of the dozens SFML's messages.
I learnt that I can't disable the messages and that they are sent to a specific ostream owned by SFML. Can I do something on that ostream to avoid the messages to be printed ?

Thanks for your help.

Foaly

  • Sr. Member
  • ****
  • Posts: 453
    • View Profile
Re: [SFML 2.0] Disabling error message
« Reply #1 on: March 18, 2013, 10:45:59 pm »
A quick look in the documentation would have shown you that this:
 // Redirect to nothing
 sf::err().rdbuf(NULL);
"disables" SFMLs error messages, by redirecting the stream to nothing.

Hindi

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: [SFML 2.0] Disabling error message
« Reply #2 on: March 19, 2013, 01:22:56 am »
A quick look at the documentation and the thread on the forum gave me the informations I wrote on the first post.

Anyway, thank you for your anwer, it helps a lot.