MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / OnBeginUpdate

Method OnBeginUpdate

Source/Engine/Engine/Time.cpp:271–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269}
270
271bool Time::OnBeginUpdate(double time)
272{
273#if !USE_EDITOR
274 // Pause game if window lost focus (based on game settings)
275 bool gamePausedUnfocsed = !Engine::HasFocus && UnfocusedPause;
276 if (gamePausedUnfocsed != _gamePausedUnfocsed)
277 {
278 _gamePausedUnfocsed = gamePausedUnfocsed;
279 if (!gamePausedUnfocsed)
280 {
281 // Reset ticking
282 const double time = Platform::GetTimeSeconds();
283 Update.OnReset(UpdateFPS, time);
284 Physics.OnReset(PhysicsFPS, time);
285 Draw.OnReset(DrawFPS, time);
286 }
287 }
288#endif
289
290 if (Update.OnTickBegin(time, GetFps(UpdateFPS), MaxUpdateDeltaTime))
291 {
292 Current = &Update;
293 return true;
294 }
295 return false;
296}
297
298bool Time::OnBeginPhysics(double time)
299{

Callers

nothing calls this directly

Calls 3

GetFpsFunction · 0.85
OnResetMethod · 0.80
OnTickBeginMethod · 0.80

Tested by

no test coverage detected