Engine
Raylib based game framework
Loading...
Searching...
No Matches
Scene Class Referenceabstract

Base class for all scenes. More...

#include <SceneManager.hpp>

Inheritance diagram for Scene:
Collaboration diagram for Scene:

Public Member Functions

virtual void Update (const float deltaT)=0
 Updates the scene.
virtual void Draw () const
 Renders the scene.
virtual void OnEnter ()
 Called by the engine when this scene becomes the active scene.
virtual void OnExit ()
 Called by the engine just before this scene is replaced by another.

Detailed Description

Base class for all scenes.

All scenes must derive from this class and implement Update.

Member Function Documentation

◆ Draw()

void Scene::Draw ( ) const
virtual

Renders the scene.

Called once per frame after systems. Default implementation does nothing.

◆ OnEnter()

void Scene::OnEnter ( )
virtual

Called by the engine when this scene becomes the active scene.

Use this for one-time setup that depends on the scene being visible (e.g. spawning entities, starting music). Default implementation does nothing.

◆ OnExit()

void Scene::OnExit ( )
virtual

Called by the engine just before this scene is replaced by another.

Use this for cleanup (e.g. destroying entities, stopping music). Default implementation does nothing.

◆ Update()

virtual void Scene::Update ( const float deltaT)
pure virtual

Updates the scene.

Called after systems each fixed-timestep step.

Parameters
deltaTDuration of the previous frame in seconds

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