|
Deki 0.19.0
Modular C++ 2D engine for embedded displays and desktop
|
Loads and owns the root scene, the scene that is running, and keeps the persistent objects that outlive scene changes. More...
#include <deki/SceneSystem.h>
Public Member Functions | |
| SceneSystem () | |
| ~SceneSystem () | |
| bool | Setup () |
| Returns false on failure. | |
| void | Update (uint32_t deltaTime) |
| Updates the current scene. deltaTime is in milliseconds. | |
| void | SetRootScene (Scene *scene, bool takeOwnership=true) |
| Makes scene the root scene. | |
| Scene * | CreateScene () |
| Creates an empty scene. | |
| bool | LoadBootScene (const char *path) |
| Loads the scene at path (full path with storage prefix) and makes it the root scene. | |
| bool | LoadBootScene (const char *filename, Storage::Location storage) |
| Loads filename (such as "boot.scene") from storage and makes it the root scene. | |
| Scene * | GetRootScene () const |
| bool | HasRootScene () const |
| void | MarkPersistent (Object *obj) |
| Removes obj from its scene and keeps it alive across scene changes. | |
| const std::vector< Object * > & | GetPersistentObjects () const |
| void | ClearPersistentObjects (bool deleteObjects=true) |
| Empties the persistent list, deleting the objects when deleteObjects. | |
| void | FlushPendingDeletions () |
| Deletes the scenes queued by SetRootScene. | |
Loads and owns the root scene, the scene that is running, and keeps the persistent objects that outlive scene changes.
| Deki::SceneSystem::SceneSystem | ( | ) |
| Deki::SceneSystem::~SceneSystem | ( | ) |
| bool Deki::SceneSystem::Setup | ( | ) |
Returns false on failure.
| void Deki::SceneSystem::Update | ( | uint32_t | deltaTime | ) |
Updates the current scene. deltaTime is in milliseconds.
| void Deki::SceneSystem::SetRootScene | ( | Scene * | scene, |
| bool | takeOwnership = true ) |
Makes scene the root scene.
With takeOwnership, it is deleted when replaced or on shutdown.
| Scene * Deki::SceneSystem::CreateScene | ( | ) |
Creates an empty scene.
| bool Deki::SceneSystem::LoadBootScene | ( | const char * | path | ) |
Loads the scene at path (full path with storage prefix) and makes it the root scene.
Returns false on failure.
| bool Deki::SceneSystem::LoadBootScene | ( | const char * | filename, |
| Storage::Location | storage ) |
Loads filename (such as "boot.scene") from storage and makes it the root scene.
Returns false on failure.
|
inline |
|
inline |
| void Deki::SceneSystem::MarkPersistent | ( | Object * | obj | ) |
Removes obj from its scene and keeps it alive across scene changes.
|
inline |
| void Deki::SceneSystem::ClearPersistentObjects | ( | bool | deleteObjects = true | ) |
Empties the persistent list, deleting the objects when deleteObjects.
The editor calls it when play mode ends.
| void Deki::SceneSystem::FlushPendingDeletions | ( | ) |
Deletes the scenes queued by SetRootScene.
Called at the start of ProcessLifecycle and of the play mode tick, before any behaviour code runs, when nothing iterates the old scene.