@Grimmov: My friend, welcome to frame clamp loops! (it is what I call them anyway)
I assume that your run loop functions similar to this:
- Gather input
- Update the scene
- Render the scene
- repeat
What you want to do is remove the frame rates dependence on how fast the game can update. So instead of the above do something similar to this:
target frame rate = 60 frames
time between frames = 1 second / target frame rate
render time = 0;
delta time
start loop
while render time < time between frames,
record the current time
gather user input
update the scene(using delta)
subtract the recorded time from the current time and set delta equal to it
then add delta to render time
As soon as render time becomes equal to, or greater than, time between frames this loop ends and you move on to rendering
render
set render time = 0
repeat
Now your loop keeps updating the scene (doing calculations, gathering user input, and running all your math) until you need to render. Then you render, reset some variables and repeat the process.
obviously the above is not code, but when you implement this right, you get rock solid frame rates, and a loop that preforms the same on most computers (I only say most because there are some dinosaurs out there)
This is a fairly common approach to your problem (not the vsync part, but the reason you think you HAVE to have vsync)
If I wasn’t so lazy I would link you to a good post from this forum on game loops, but for now I hope this is helpful.