I have my physics engine, which always updates at 60Hz.
Then I have my Window, which can be a variable FPS with setFrameRate.
As it stands, the game will reach the physics update and do a physics calculation as many times as it needs until it has reached the number of updates expected. (so if you are running at 30 fps, it will update 2 times, 20 fps, 3 times, ect.)
The problem is that player input, and the rest of my game loop, seems to be tied to frame rate. The physics input needs input from the keyboard each update, because if you press UP, you need to accelerate each update. If someone sets their frame rate to 30 fps, the physics engine is still at 60HZ, but now only half of those ticks are getting player input and accelerating the player.
Possible solutions I have thought of:
1. Ideally I can get player input independently of frame rate. This would be great!
2. Force the same rate for everything. This is bad if someones computer just can't keep up. Then that person couldn't play with someone else, cause their game would constantly be behind.
3. Record the players input, and keep it until we get new input, and have each physics tick act on whatever information was recorded. This is better than 2, but not better than 1.
The real problem is I don't understand how sf::event and sf::Keyboard are tied to the window. Do they only get updated each frame, or are they a continuous and independent from it?