9chu/fancy2d

a bug in f2dFPSControllerImpl

Xrysnow opened this issue · 1 comments

timeBeginPeriodtimeEndPeriod 应紧挨 Sleep ,否则会受到其他程序的影响。

f2dFPSControllerImpl(fuInt MaxFPS)
: m_TotalFrame(0), m_TotalTime(0), m_MaxFPS(0), m_CurFPS(0),
m_FrameTimeSecond(0), m_FrameCountSecond(0),
m_FPSMax(MaxFPS), m_FrameDelay(MaxFPS?1./MaxFPS : 0)
{
timeBeginPeriod(1);
}
~f2dFPSControllerImpl()
{
timeEndPeriod(1);
}

9chu commented

https://groups.google.com/forum/#!topic/borland.public.delphi.nativeapi.win32/FFV2KU62ht4

"Windows uses the lowest value (that is, highest resolution) requested by any process."