Module managing the scene queue and transitions.
More...
#include <NcScene.h>
|
virtual auto | Queue (std::unique_ptr< Scene > scene) noexcept -> size_t=0 |
| Add a scene to the scene queue. More...
|
|
virtual void | DequeueScene (size_t queuePosition)=0 |
| Remove a scene from the scene queue.
|
|
virtual auto | GetNumberOfScenesInQueue () const noexcept -> size_t=0 |
| Get the number of scenes in the scene queue.
|
|
virtual void | ScheduleTransition () noexcept=0 |
| Schedule a transition to the next queued scene upon completion of the current frame.
|
|
virtual auto | IsTransitionScheduled () const noexcept -> bool=0 |
| Check if a scene transition is currently scheduled.
|
|
virtual auto | UnloadActiveScene () -> bool=0 |
| Unload the active scene and destroy it. More...
|
|
virtual auto | LoadQueuedScene (ecs::Ecs world, ModuleRegistry &modules) -> bool=0 |
| Load the next scene from the scene queue. More...
|
|
| Module (size_t id=0) noexcept |
| Constructor for the Module interface. More...
|
|
auto | Id () const noexcept |
| Get the module's unique id.
|
|
virtual void | OnBuildTaskGraph (task::UpdateTasks &, task::RenderTasks &) |
| Called on registered modules when the task graphs are constructed.
|
|
virtual void | OnBeforeSceneLoad () |
| Called on registered modules prior to loading a new scene.
|
|
virtual void | OnBeforeSceneFragmentLoad () |
| Called on registered modules immediately before loading a SceneFragment file.
|
|
virtual void | OnAfterSceneFragmentLoad () |
| Called on registered modules immediately after loading a SceneFragment file.
|
|
virtual void | Clear () noexcept |
| Called on registered modules prior to clearing the Registry. This includes Scene::Unload() and NcEngine::Shutdown().
|
|
Module managing the scene queue and transitions.
The simplest and preferred method of changing Scenes is by queueing the desired Scene(s) and calling ScheduleTransition() when it is time to perform the transition. This schedules the transition at the end of the frame, guaranteeing no tasks are in flight. The following routine is performed before starting the next frame:
- Unload() is called on the active Scene.
- The active Scene's destructor is called.
- Clear() is called on all registered Modules.
- ClearSceneData() is called on the ComponentRegistry.
- OnBeforeSceneLoad() is called on each Module.
- Dequeue the next queued Scene and call Load().
◆ LoadQueuedScene()
Load the next scene from the scene queue.
- Returns
- True if the scene was loaded or false if no scene's are queued.
- Exceptions
-
NcError | if there is an active scene loaded. |
- Note
- Loading is automatically handled internally when ScheduleTransition() is used.
◆ Queue()
virtual auto nc::NcScene::Queue |
( |
std::unique_ptr< Scene > |
scene | ) |
-> size_t |
|
pure virtualnoexcept |
Add a scene to the scene queue.
- Returns
- The added scene's position in the scene queue.
◆ UnloadActiveScene()
virtual auto nc::NcScene::UnloadActiveScene |
( |
| ) |
-> bool |
|
pure virtual |
Unload the active scene and destroy it.
- Returns
- True if the scene was unloaded or false if there is no active scene.
- Note
- Unloading is automatically handled internally when ScheduleTransition() is used.
The documentation for this class was generated from the following file: