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

Author Topic: SFML error checking and exceptions  (Read 4665 times)

0 Members and 1 Guest are viewing this topic.

mercurio7891

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
SFML error checking and exceptions
« 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?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML error checking and exceptions
« Reply #1 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.
Laurent Gomila - SFML developer

Silvah

  • Guest
SFML error checking and exceptions
« Reply #2 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"?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML error checking and exceptions
« Reply #3 on: December 27, 2010, 02:07:18 pm »
Yes, sorry.
Laurent Gomila - SFML developer

 

anything