I see a lot of this topics and still doesn't work for me:
sf::RenderWindow window(sf::VideoMode(640, 480), "My window");
window.setFramerateLimit(60);
sf::Texture tex;
tex.loadFromFile("bomberman.png");
sf::Sprite sprite;
sprite.setTexture( tex );
auto move = 100.f;
auto dt = 0.f;
sf::Clock clock;
while (window.isOpen()){
sf::Event event;
while (window.pollEvent(event)){
if (event.type == sf::Event::Closed)
window.close();
}
sprite.move( move * dt, 0 );
window.clear();
window.draw( sprite );
window.display();
auto& pos = sprite.getPosition();
if((pos.x > 640) || (pos.x < 0)) move = -move;
dt = clock.restart().asSeconds();
}
The sprite speed up randomly (small but perceptible jumps).
I read about here
http://gafferongames.com/game-physics/fix-your-timestep/ and here
http://gamedev.tutsplus.com/tutorials/implementation/how-to-create-a-custom-2d-physics-engine-the-core-engine/.
Implemented the timestepping and the interpolation rendering.
Implemented everything on sdl2.
Tried also on different computers.
And run the sfml examples.
All have the same problem.
And in all cases, without frame limit or vsync (or with framelimit >=75 (+-) ) all runs smooth.
At 60fps or less the problem continues.
Thank you for the patience!