-
Notifications
You must be signed in to change notification settings - Fork 5
Scene
Shahriar Shahrabi edited this page May 11, 2020
·
3 revisions
The scene class contains all the objects in the game world. Its main job is to propagate the OnStart, OnUpdate, OnRender calls down the scene hierarchy, so that each component receives a chance to call its game logic. For more information on how the bigger picture works, have a look at the Engine Loop.
The Scene is destroyed by the ToyRendererApp class, either during its destruction or whenever it is necessarily. The Scene itself has ownership over the GameObject it holds, and deletes them once it is destroyed. Gameobejcts are unique and shouldn't be shared across Scenes.
Its main functions are:
Function name | Purpose |
---|---|
OnStart() | For initialization of game logic and values after the scene construction |
OnUpdate() | For running the main CPU orientated Game logic |
OnRender() | Used for rendering calls to the RHI after the game logic |
OnGui() | Used for GUI rendering as well as GUI logic |
Its main member values are:
Member | Purpose |
---|---|
Renderer* | Encapsulates the Draw command, as well as initializing the Graphics class which is a utility class |