Forgot to say, use the high resolution clock

Ian wrote:Harry, I want to push this timing fix. Unfortunately vs2013 only has low resolution timers, so I can't really test it. With your compile could you disable v sync on your pc then pause a game and see exactly what fps you get? With any luck it'll be almost bang on 60..
Forgot to say, use the high resolution clock
Ian wrote:You should always enable v-sync ;p
Since you run with v-sync disabled, surely you get higher than 60fps unthrottled?
...
What I was attempting to due was a software v-sync. So each frame should be exactly 16.6 ms or whatever the internal is.
If you are only hitting 59.940056 maybe we need to tweak the code a bit.
Ian wrote:Are you using a TV?
UINT64 GetSuperTime()
{
LARGE_INTEGER time;
QueryPerformanceCounter(&time);
return (time.QuadPart * 1000000) / frequency.QuadPart;
}
static void SuperSleep(LONGLONG time)
{
auto start = GetSuperTime();
auto tics = start;
while (start + time > tics) {
tics = GetSuperTime();
}
}
Users browsing this forum: No registered users and 1 guest