dimanche 3 janvier 2016

sfml 2.2 fps function repeating numbers

When I try to show an fps counter in my program with this code:

sf::Clock clock;
sf::Time time = clock.getElapsedTime();
std::cout << 1.0f / time.asSeconds() << std::endl;
clock.restart().asSeconds();

It just repeats the numbers "500000" and "333333", even though I set the framerate limit to 60. Any ideas on how to fix this?

Aucun commentaire:

Enregistrer un commentaire