Original Post
So I'm trying to limit my physics updating to 60 times a frame and I've accomplished that when vsync is off however when I turn vsync on, things mess up.
What I'm doing is this.
at framestart
I use QueryPerformanceCounter counter to get a start time.
I also have oldtime initialized to 0;
then I do:
if(time - oldTime > frequency / framerate)
updatephysics();
QueryPerformanceCounter(oldTime);
I don't know why but it's slowing down when vsync is turned on.
I think maybe it's because I'm calling the code when a frame is started? Instead of updating seperately from the render code?
What I'm doing is this.
at framestart
I use QueryPerformanceCounter counter to get a start time.
I also have oldtime initialized to 0;
then I do:
if(time - oldTime > frequency / framerate)
updatephysics();
QueryPerformanceCounter(oldTime);
I don't know why but it's slowing down when vsync is turned on.
I think maybe it's because I'm calling the code when a frame is started? Instead of updating seperately from the render code?