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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - someguyk

Pages: [1]
1
General / Re: How do I pause an sf::Clock? (SFML 2.0)
« on: June 25, 2013, 07:18:43 pm »
I'm using your Chronometer header now and everything is working perfectly.

Thank you so much :)

2
General / Re: How do I pause an sf::Clock? (SFML 2.0)
« on: June 25, 2013, 07:08:05 pm »
Thanks, I'll take a look at that.

3
General / Re: How do I pause an sf::Clock? (SFML 2.0)
« on: June 25, 2013, 06:31:42 pm »
Thank you!

Do you know by any chance if there is such code already available? I would rather use that code instead of using a new C++ library just for the timer.

I have Googled like crazy (after trying for myself and failing) but couldn't find anything.

4
General / How do I pause an sf::Clock? (SFML 2.0)
« on: June 25, 2013, 06:24:44 pm »
Hi,

I would like to know how to pause a clock.

At the start of my program I have:
sf::Clock timer_clock;
sf::Time timer_elapsedTime = timer_clock.restart();
float timer_currentTime = 0.0f;

This is how I update the timer:
timer_elapsedTime = timer_clock.getElapsedTime();
timer_currentTime = timer_elapsedTime.asSeconds();
// (...) here I set timer_currentTime as a string but it's not relevant.

Everything is working fine.

But now I want to pause the clock when my game is in a "paused game state", but it keeps running when my game is paused. Since I haven't found out how to pause the clock, do I have to use arithmetics or something?

Please guys, I need your help. My knowledge is depleted :(
Thank you so much!

Pages: [1]