mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-06-01 05:22:02 +08:00
Reduce FPS when CW is not in the foreground
This commit is contained in:
@@ -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))
|
||||||
|
|||||||
Reference in New Issue
Block a user