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

Author Topic: How does SFML handle errors?  (Read 2905 times)

0 Members and 1 Guest are viewing this topic.

Wibbs

  • Newbie
  • *
  • Posts: 40
    • View Profile
How does SFML handle errors?
« on: October 27, 2009, 11:23:23 am »
Hi all,

Just a quick question....I've been reading through the docs and tutorials, but so far I haven't seen any mention of how SFML handles errors.  For example, what would happen if SFML couldn't detect a mouse or keyboard, or the video card on the machine wasn't compatible?

Thanks,

Wibbs

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
How does SFML handle errors?
« Reply #1 on: October 27, 2009, 11:43:44 am »
What you're talking about are not errors: if there's no keyboard or mouse then you will simply not receive the corresponding events, and the graphics card cannot be "not compatible" (it will always work unless you don't have an OpenGL implementation installed -- in this case you'll probably have a "shared library missing" message from the OS).
Laurent Gomila - SFML developer

Wibbs

  • Newbie
  • *
  • Posts: 40
    • View Profile
How does SFML handle errors?
« Reply #2 on: October 27, 2009, 12:07:08 pm »
So there are no exceptions or error code type issues to worry about and handle that are specific to SFML?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
How does SFML handle errors?
« Reply #3 on: October 27, 2009, 12:12:27 pm »
The SFML functions that may fail return a boolean, and write a message on the standard error output if any error occured. That's all.
Laurent Gomila - SFML developer

Wibbs

  • Newbie
  • *
  • Posts: 40
    • View Profile
How does SFML handle errors?
« Reply #4 on: October 27, 2009, 10:46:18 pm »
Cool thanks - makes it nice and straightforward to use :)

 

anything