So I bought the SFML GameDev by example.
I was just curious if why is the clock keeps getting called without being called in the game loop
sf::Clock clock;
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(shape);
window.display();
sf::Time a = clock.restart();
std::cout << a.asSeconds() << std::endl;
}
The restart function puts the time counter back to zero so it should be the the output I will get is 0 up until the end. Does that mean the the clock has its own game loop under the hood?