I was just wondering about general things from the code below is anyone can help.
#1 Does calling process"Polling Events" matter that its only updated 60 times a second ?
#2 Is it a waste to render as fast as possible ?
Thanks
// This code is from https://github.com/SFML/SFML-Game-Development-Book
void Game::run()
{
sf::Clock clock;
sf::Time timeSinceLastUpdate = sf::Time::Zero;
while (mWindow.isOpen())
{
sf::Time elapsedTime = clock.restart();
timeSinceLastUpdate += elapsedTime;
while (timeSinceLastUpdate > TimePerFrame)
{
timeSinceLastUpdate -= TimePerFrame;
processEvents();
update(TimePerFrame);
}
updateStatistics(elapsedTime);
render();
}
}