Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 09 Apr 2012
Offline Last Active Jan 13 2015 11:25 AM

Posts I've Made

In Topic: Frame time limiting problems

22 November 2012 - 04:41 PM

Hi Lipsryme,

You want to limit your fps to 60. What I don't understand is why you divide your "timeDifference" by the ticks of the CPU. Maybe should you try to assign "frameTime" to "timeDifference".

I think that what you're doing by dividing by cpu's tick limit the "frameTime" and so don't trigger the "if" condition.
[source lang="cpp"]if(frameTime >= (1000 / 60))[/source]

So let's try with :

[source lang="cpp"]void Timer::Frame(){INT64 currentTime;double timeDifference;QueryPerformanceCounter((LARGE_INTEGER*)&currentTime);timeDifference = (double)(currentTime - this->startTime);this->frameTime = timeDifference /* this->ticksPerMs*/;this->startTime = currentTime;}[/source]

Tell me if it work, or not Posted Image.