SFML community forums

Help => Window => Topic started by: mercurio7891 on December 27, 2010, 12:11:50 pm

Title: SFML error checking and exceptions
Post by: mercurio7891 on December 27, 2010, 12:11:50 pm
Hi, do SFML throw exceptions in any of the classes? If not how should I check for failures? for example when creating the sf::Window class, how would I know if the constructor failed? or sf::Window::Create failed?
Title: SFML error checking and exceptions
Post by: Laurent on December 27, 2010, 12:20:35 pm
SFML doesn't use exceptions. Everything that may fail returns a boolean, and prints a message in standard output on failure.

Constructors and functions that don't return a boolean, such as Window::Window and Window::Create, cannot fail.
Title: SFML error checking and exceptions
Post by: Silvah on December 27, 2010, 01:53:29 pm
Quote from: "Laurent"
prints a message in standard output on failure.
Did you mean "standard error output"?
Title: SFML error checking and exceptions
Post by: Laurent on December 27, 2010, 02:07:18 pm
Yes, sorry.