DEKI/ENGINE docs
Deki 0.19.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches
Deki::SceneSystem Class Reference

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.

Detailed Description

Loads and owns the root scene, the scene that is running, and keeps the persistent objects that outlive scene changes.

Constructor & Destructor Documentation

◆ SceneSystem()

Deki::SceneSystem::SceneSystem ( )

◆ ~SceneSystem()

Deki::SceneSystem::~SceneSystem ( )

Member Function Documentation

◆ Setup()

bool Deki::SceneSystem::Setup ( )

Returns false on failure.

◆ Update()

void Deki::SceneSystem::Update ( uint32_t deltaTime)

Updates the current scene. deltaTime is in milliseconds.

◆ SetRootScene()

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

Makes scene the root scene.

With takeOwnership, it is deleted when replaced or on shutdown.

◆ CreateScene()

Scene * Deki::SceneSystem::CreateScene ( )

Creates an empty scene.

◆ LoadBootScene() [1/2]

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.

◆ LoadBootScene() [2/2]

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.

◆ GetRootScene()

Scene * Deki::SceneSystem::GetRootScene ( ) const
inline

◆ HasRootScene()

bool Deki::SceneSystem::HasRootScene ( ) const
inline

◆ MarkPersistent()

void Deki::SceneSystem::MarkPersistent ( Object * obj)

Removes obj from its scene and keeps it alive across scene changes.

◆ GetPersistentObjects()

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

◆ ClearPersistentObjects()

void Deki::SceneSystem::ClearPersistentObjects ( bool deleteObjects = true)

Empties the persistent list, deleting the objects when deleteObjects.

The editor calls it when play mode ends.

◆ FlushPendingDeletions()

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.


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