9chu / fancy2d

Windows平台上基于DirectX9的2D游戏底层框架

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

a bug in f2dFPSControllerImpl

Xrysnow opened this issue · 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);
}

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."