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

SceneSystem class for managing the root scene. More...

#include <SceneSystem.h>

Public Member Functions

 SceneSystem ()
 Constructor - initializes the scene system.
 ~SceneSystem ()
 Destructor - cleans up resources.
bool Setup ()
 Setup the scene system.
void Update (uint32_t deltaTime)
 Update the current scene.
void SetRootScene (Scene *scene, bool takeOwnership=true)
 Set the current root scene.
SceneCreateScene ()
 Create a new empty scene.
bool LoadBootScene (const char *path)
 Load a boot scene from file and set it as active.
bool LoadBootScene (const char *filename, DekiStorage::Location storage)
 Load a boot scene from a storage location.
SceneGetRootScene () const
 Get the current root scene.
bool HasRootScene () const
 Check if there is a root scene.
void MarkPersistent (DekiObject *obj)
 Mark an object as Persistent and move it to persistent storage The object will be removed from its current scene and persisted independently.
const std::vector< DekiObject * > & GetPersistentObjects () const
 Get all Persistent objects.
void ClearPersistentObjects (bool deleteObjects=true)
 Clear all Persistent objects (call when exiting play mode in editor).
void FlushPendingDeletions ()
 Flush any scenes queued for deferred deletion.

Detailed Description

SceneSystem class for managing the root scene.

This class handles scene loading, management, and lifecycle operations. It provides a clean separation between the DekiEngine core and scene management.

The "root scene" is the currently running scene.

Constructor & Destructor Documentation

◆ SceneSystem()

SceneSystem::SceneSystem ( )

Constructor - initializes the scene system.

◆ ~SceneSystem()

SceneSystem::~SceneSystem ( )

Destructor - cleans up resources.

Member Function Documentation

◆ Setup()

bool SceneSystem::Setup ( )

Setup the scene system.

Returns
true if setup successful, false otherwise

◆ Update()

void SceneSystem::Update ( uint32_t deltaTime)

Update the current scene.

Parameters
deltaTimeTime since last update in milliseconds

◆ SetRootScene()

void SceneSystem::SetRootScene ( Scene * scene,
bool takeOwnership = true )

Set the current root scene.

Parameters
scenePointer to the scene to set as root
takeOwnershipIf true, SceneSystem will delete the scene when replaced or on shutdown

◆ CreateScene()

Scene * SceneSystem::CreateScene ( )

Create a new empty scene.

Returns
Pointer to the created scene

◆ LoadBootScene() [1/2]

bool SceneSystem::LoadBootScene ( const char * path)

Load a boot scene from file and set it as active.

Parameters
pathFull path to the scene file (including storage prefix)
Returns
true if loaded successfully

◆ LoadBootScene() [2/2]

bool SceneSystem::LoadBootScene ( const char * filename,
DekiStorage::Location storage )

Load a boot scene from a storage location.

Parameters
filenameScene filename (e.g., "boot.scene")
storageStorage location to load from
Returns
true if loaded successfully

◆ GetRootScene()

Scene * SceneSystem::GetRootScene ( ) const
inline

Get the current root scene.

Returns
Pointer to the current scene

◆ HasRootScene()

bool SceneSystem::HasRootScene ( ) const
inline

Check if there is a root scene.

Returns
true if there is a root scene, false otherwise

◆ MarkPersistent()

void SceneSystem::MarkPersistent ( DekiObject * obj)

Mark an object as Persistent and move it to persistent storage The object will be removed from its current scene and persisted independently.

It will survive scene changes without being destroyed or re-added.

Parameters
objThe object to persist

◆ GetPersistentObjects()

const std::vector< DekiObject * > & SceneSystem::GetPersistentObjects ( ) const
inline

Get all Persistent objects.

Returns
Reference to the vector of persistent objects

◆ ClearPersistentObjects()

void SceneSystem::ClearPersistentObjects ( bool deleteObjects = true)

Clear all Persistent objects (call when exiting play mode in editor).

Parameters
deleteObjectsIf true, deletes the objects. If false, just clears the list.

◆ FlushPendingDeletions()

void SceneSystem::FlushPendingDeletions ( )

Flush any scenes queued for deferred deletion.

Called at the START of ProcessLifecycle / play mode tick, before any behaviour code runs. Safe because no code is iterating over the old scene.


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