A little bit less naive limiter
This commit is contained in:
parent
d0cb042ff4
commit
3671fa1991
1 changed files with 10 additions and 4 deletions
|
@ -51,19 +51,25 @@ namespace Ryujinx
|
||||||
|
|
||||||
long TicksPerFrame = Stopwatch.Frequency / 60;
|
long TicksPerFrame = Stopwatch.Frequency / 60;
|
||||||
|
|
||||||
|
long Ticks = 0;
|
||||||
|
|
||||||
while (Exists && !IsExiting)
|
while (Exists && !IsExiting)
|
||||||
{
|
{
|
||||||
ProcessEvents();
|
ProcessEvents();
|
||||||
|
|
||||||
if (!IsExiting)
|
if (!IsExiting)
|
||||||
{
|
|
||||||
if (Chrono.ElapsedTicks > TicksPerFrame)
|
|
||||||
{
|
{
|
||||||
UpdateFrame();
|
UpdateFrame();
|
||||||
|
|
||||||
RenderFrame();
|
Ticks += Chrono.ElapsedTicks;
|
||||||
|
|
||||||
Chrono.Restart();
|
Chrono.Restart();
|
||||||
|
|
||||||
|
if (Ticks > TicksPerFrame)
|
||||||
|
{
|
||||||
|
RenderFrame();
|
||||||
|
|
||||||
|
Ticks -= TicksPerFrame;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue