SFML community forums

Help => General => Topic started by: virus on October 18, 2010, 11:03:53 pm

Title: Handling time?
Post by: virus on October 18, 2010, 11:03:53 pm
Hello,

I would like to remember that is impossible to explain my problem without comparing SFML and Allegro.

In Allegro i can set a timeout and a function is called everytime this timeout is reached. Can I do that in SFML?

I mean, when you are building a game, you can't just have a complex full time runtime, controlling execution with "sf::Sleep"...

What is the best way to separate TIME HANDLING from the rest of the game?

I would like to create a timeline of functions to be executed, with ticks (40 each second), how can I do that?

If its not possible, again, what is the best way to control time?

Thank you :)
(I am sorry, it is kinda confusing)
Title: Handling time?
Post by: Kingdom of Fish on October 18, 2010, 11:11:09 pm
What you want to be looking at is threads.
Title: Re: Handling time?
Post by: panithadrum on October 19, 2010, 08:08:57 am
Quote from: "virus"
what is the best way to control time?

You can use sf::Clock, sf::Sleep and/or sf::Window::SetFramerateLimit