Add setting for specifying custom framerate when window is not active
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include "Engine/Scripting/ManagedCLR/MUtils.h"
|
||||
#include "Engine/Scripting/ManagedCLR/MMethod.h"
|
||||
#include "Engine/Scripting/ManagedCLR/MClass.h"
|
||||
#include "Engine/Engine/Time.h"
|
||||
|
||||
#if USE_CSHARP
|
||||
// Helper macros for calling C# events
|
||||
@@ -436,6 +437,9 @@ void WindowBase::OnGotFocus()
|
||||
return;
|
||||
_focused = true;
|
||||
|
||||
if (RenderTask && _settings.WindowFPSWhenNotFocused > ZeroTolerance)
|
||||
RenderTask->RenderFPS = 0;
|
||||
|
||||
GotFocus();
|
||||
INVOKE_EVENT_PARAMS_0(OnGotFocus);
|
||||
}
|
||||
@@ -446,6 +450,9 @@ void WindowBase::OnLostFocus()
|
||||
return;
|
||||
_focused = false;
|
||||
|
||||
if (RenderTask && _settings.WindowFPSWhenNotFocused > ZeroTolerance)
|
||||
RenderTask->RenderFPS = _settings.WindowFPSWhenNotFocused;
|
||||
|
||||
LostFocus();
|
||||
INVOKE_EVENT_PARAMS_0(OnLostFocus);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user