DEKI/ENGINE docs
manual api reference
Deki 0.40.1
Modular C++ engine with a visual editor, for 2D and 3D
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 ()
void ClearPersistentObjects (bool deleteObjects=true)
 Empties the persistent list, deleting the objects when deleteObjects.
Scene * CreateScene ()
 Creates an empty scene.
void FlushPendingDeletions ()
 Deletes the scenes queued by SetRootScene.
void ForgetPersistent (Object *obj)
 Takes obj off the persistent list, because it is being deleted.
const std::vector< Object * > & GetPersistentObjects () const
Scene * GetRootScene () const
uint32_t GetRootSceneSerial () const
 Changes every time the root scene is replaced.
bool HasRootScene () const
bool LoadBootScene (const char *filename, Storage::Location storage)
 Loads filename (such as "boot.scene") from storage and makes it the root scene.
bool LoadBootScene (const char *path)
 Loads the scene at path (full path with storage prefix) and makes it the root scene.
void MarkPersistent (Object *obj)
 Removes obj from its scene and keeps it alive across scene changes.
void SetRootScene (Scene *scene, bool takeOwnership=true)
 Makes scene the root scene.
bool Setup ()
 Returns false on failure.
void Update (uint32_t deltaTime)
 Updates the current scene. deltaTime is in milliseconds.

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

◆ 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.

◆ CreateScene()

Scene * Deki::SceneSystem::CreateScene ( )

Creates an empty scene.

◆ 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, and before a scene set later in the frame is started: when nothing iterates the old scene.

◆ ForgetPersistent()

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

Takes obj off the persistent list, because it is being deleted.

◆ GetPersistentObjects()

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

◆ GetRootScene()

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

◆ GetRootSceneSerial()

uint32_t Deki::SceneSystem::GetRootSceneSerial ( ) const
inline

Changes every time the root scene is replaced.

Compare it, not the scene's address, to tell whether the scene changed: a scene switch frees the old scene before loading the next, which may then be allocated at the very same address.

◆ HasRootScene()

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

◆ LoadBootScene() [1/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.

◆ LoadBootScene() [2/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.

◆ MarkPersistent()

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

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

◆ 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.

◆ 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.


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