Deki 1.3.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches

Manages DekiBehaviour lifecycle (InternalAwake, Awake, Start, Update). More...

#include <LifecycleManager.h>

Public Member Functions

 LifecycleManager ()=default
 ~LifecycleManager ()=default
void ProcessInternalAwake (Scene *scene)
 Resolve AssetRefs and ObjectRefs for all behaviours that haven't awoken.
void ProcessAwake (Scene *scene)
 Process Awake for all behaviours that haven't awoken yet.
void ProcessStart (Scene *scene)
 Process Start for all behaviours that haven't started yet.
void ProcessUpdate (Scene *scene)
 Process Update for all behaviours that have started.
void ProcessRuntimeUpdate (Scene *scene, float deltaTime)
 Drive RuntimeUpdate() on every component that opts in via NeedsRuntimeUpdate().

Static Public Member Functions

static void SetProfilingCallbacks (LifecycleProfileBeginCallback begin, LifecycleProfileEndCallback end)
 Set profiling callbacks for lifecycle method instrumentation.

Static Public Attributes

static LifecycleProfileBeginCallback s_ProfileBegin
static LifecycleProfileEndCallback s_ProfileEnd

Detailed Description

Manages DekiBehaviour lifecycle (InternalAwake, Awake, Start, Update).

Centralizes all lifecycle method invocation and reference resolution. Called by DekiEngine during the update phase, before rendering.

Lifecycle order:

  1. ProcessInternalAwake() - Resolves AssetRefs and ObjectRefs
  2. ProcessAwake() - Calls Awake() on all behaviours
  3. ProcessStart() - Calls Start() on all behaviours
  4. ProcessUpdate() - Called every frame for started behaviours
  5. Render (handled separately by render system)

Constructor & Destructor Documentation

◆ LifecycleManager()

LifecycleManager::LifecycleManager ( )
default

◆ ~LifecycleManager()

LifecycleManager::~LifecycleManager ( )
default

Member Function Documentation

◆ SetProfilingCallbacks()

void LifecycleManager::SetProfilingCallbacks ( LifecycleProfileBeginCallback begin,
LifecycleProfileEndCallback end )
static

Set profiling callbacks for lifecycle method instrumentation.

When set, these callbacks are invoked around each Update/Start/Awake call with the component type name (e.g., "TestComponent.Update"). Set to nullptr to disable profiling (default on embedded devices).

◆ ProcessInternalAwake()

void LifecycleManager::ProcessInternalAwake ( Scene * scene)

Resolve AssetRefs and ObjectRefs for all behaviours that haven't awoken.

This is the internal setup phase where the engine resolves all dependencies before any user code runs.

Parameters
sceneThe current scene

◆ ProcessAwake()

void LifecycleManager::ProcessAwake ( Scene * scene)

Process Awake for all behaviours that haven't awoken yet.

Called after InternalAwake. All asset and object references are available at this point.

Parameters
sceneThe current scene

◆ ProcessStart()

void LifecycleManager::ProcessStart ( Scene * scene)

Process Start for all behaviours that haven't started yet.

Called after all Awake calls complete. Safe to access other components.

Parameters
sceneThe current scene

◆ ProcessUpdate()

void LifecycleManager::ProcessUpdate ( Scene * scene)

Process Update for all behaviours that have started.

Parameters
sceneThe current scene

◆ ProcessRuntimeUpdate()

void LifecycleManager::ProcessRuntimeUpdate ( Scene * scene,
float deltaTime )

Drive RuntimeUpdate() on every component that opts in via NeedsRuntimeUpdate().

This is the engine-runtime counterpart to the editor play-mode walk (EditorApp::UpdatePlayMode -> updateComponentsRecursive). Components such as RollerComponent / ScrollComponent put their per-frame physics in RuntimeUpdate(), which is distinct from the script DekiBehaviour::Update() driven by ProcessUpdate(). Without this call their momentum/snap state machines never tick outside the editor.

Parameters
sceneThe current scene
deltaTimeTime since last frame in SECONDS

Member Data Documentation

◆ s_ProfileBegin

LifecycleProfileBeginCallback LifecycleManager::s_ProfileBegin
static

◆ s_ProfileEnd

LifecycleProfileEndCallback LifecycleManager::s_ProfileEnd
static

The documentation for this class was generated from the following file: