Tag Info

New answers tagged

0

Your issue here is not that you are not using sf::Window::setFramerateLimit(unsigned int limit), but that you are only actually calculating your frameTime variable once, as it is really a constant. All that you have to do is change: const sf::Int64 frameTime = 1000000/FRAMES_PER_SECOND; to: sf::Int64 frameTime = 1000000/FRAMES_PER_SECOND; and that ...


0

This might not be a solution to problem , but as far as I know main game loop should not be limited using sf::Window::setFramerateLimit(unsigned int limit). Only game logic, AI, physics should be limited, events should be processed without any limitation as not to create input lag. I would suggest: sf::Clock clock; sf::Time accumulator = sf::Time::Zero; ...



Top 50 recent answers are included