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

Author Topic: Handling time?  (Read 2319 times)

0 Members and 1 Guest are viewing this topic.

virus

  • Newbie
  • *
  • Posts: 13
    • View Profile
Handling time?
« 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)

Kingdom of Fish

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Handling time?
« Reply #1 on: October 18, 2010, 11:11:09 pm »
What you want to be looking at is threads.

panithadrum

  • Sr. Member
  • ****
  • Posts: 304
    • View Profile
    • Skyrpex@Github
    • Email
Re: Handling time?
« Reply #2 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