mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-29 18:32:55 +08:00
Reduce FPS when CW is not in the foreground
This commit is contained in:
parent
ab0bf465dc
commit
853bca2fe4
@ -281,6 +281,10 @@ namespace CodeWalker.Rendering
|
|||||||
Thread.Sleep(10); //don't hog CPU when minimised
|
Thread.Sleep(10); //don't hog CPU when minimised
|
||||||
if (dxform.Form.IsDisposed) return; //if closed while minimised
|
if (dxform.Form.IsDisposed) return; //if closed while minimised
|
||||||
}
|
}
|
||||||
|
if (Form.ActiveForm == null)
|
||||||
|
{
|
||||||
|
Thread.Sleep(100); //reduce the FPS when the app isn't active (maybe this should be configurable?)
|
||||||
|
}
|
||||||
|
|
||||||
Rendering = true;
|
Rendering = true;
|
||||||
if(!Monitor.TryEnter(syncroot, 50))
|
if(!Monitor.TryEnter(syncroot, 50))
|
||||||
|
Loading…
Reference in New Issue
Block a user