mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-26 00:43:00 +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
|
||||
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;
|
||||
if(!Monitor.TryEnter(syncroot, 50))
|
||||
|
Loading…
Reference in New Issue
Block a user