Jump to content

  • Log In with Google      Sign In   
  • Create Account


Drayan

Member Since 09 Apr 2012
Offline Last Active Nov 26 2012 10:56 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.

Regards,
Drayan

PARTNERS