|
Deki 1.3.0
Modular C++ 2D engine for embedded displays and desktop
|
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. | |
| Scene * | CreateScene () |
| 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. | |
| Scene * | GetRootScene () 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. | |
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.
| SceneSystem::SceneSystem | ( | ) |
Constructor - initializes the scene system.
| SceneSystem::~SceneSystem | ( | ) |
Destructor - cleans up resources.
| bool SceneSystem::Setup | ( | ) |
Setup the scene system.
| void SceneSystem::Update | ( | uint32_t | deltaTime | ) |
Update the current scene.
| deltaTime | Time since last update in milliseconds |
| void SceneSystem::SetRootScene | ( | Scene * | scene, |
| bool | takeOwnership = true ) |
Set the current root scene.
| scene | Pointer to the scene to set as root |
| takeOwnership | If true, SceneSystem will delete the scene when replaced or on shutdown |
| Scene * SceneSystem::CreateScene | ( | ) |
Create a new empty scene.
| bool SceneSystem::LoadBootScene | ( | const char * | path | ) |
Load a boot scene from file and set it as active.
| path | Full path to the scene file (including storage prefix) |
| bool SceneSystem::LoadBootScene | ( | const char * | filename, |
| DekiStorage::Location | storage ) |
Load a boot scene from a storage location.
| filename | Scene filename (e.g., "boot.scene") |
| storage | Storage location to load from |
|
inline |
Get the current root scene.
|
inline |
Check if there is a root scene.
| 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.
| obj | The object to persist |
|
inline |
Get all Persistent objects.
| void SceneSystem::ClearPersistentObjects | ( | bool | deleteObjects = true | ) |
Clear all Persistent objects (call when exiting play mode in editor).
| deleteObjects | If true, deletes the objects. If false, just clears the list. |
| 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.