SleakEngine 1.0.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
Scene.cpp
Go to the documentation of this file.
2#include <Core/Logger.hpp>
3
4namespace Sleak {
5
7 SLEAK_LOG("Scene '{0}' loaded.", GetName());
8}
9
11 SLEAK_LOG("Scene '{0}' unloaded.", GetName());
12}
13
15 SLEAK_LOG("Scene '{0}' activated.", GetName());
16}
17
19 SLEAK_LOG("Scene '{0}' deactivated.", GetName());
20}
21
23 return SceneBase::Initialize();
24}
25
28}
29
30void Scene::Update(float deltaTime) {
31 SceneBase::Update(deltaTime);
32}
33
34void Scene::FixedUpdate(float fixedDeltaTime) {
35 if (!bEnableFixedUpdate) return;
36 SceneBase::FixedUpdate(fixedDeltaTime);
37}
38
39void Scene::LateUpdate(float deltaTime) {
40 SceneBase::LateUpdate(deltaTime);
41}
42
43} // namespace Sleak
#define SLEAK_LOG(...)
Definition Logger.hpp:19
virtual void Update(float deltaTime)=0
Advances all active, root-level objects by deltaTime, then steps lighting and physics.
virtual void FixedUpdate(float fixedDeltaTime)
Advances all active, root-level objects on the fixed timestep.
const std::string & GetName() const
virtual bool Initialize()
Runs once before the scene's first Begin()/Update().
virtual void Begin()=0
Activates every owned object; runs once after Initialize().
virtual void LateUpdate(float deltaTime)
Advances all active, root-level objects after the main Update pass.
void Begin() override
Activates every owned object; runs once after Initialize().
Definition Scene.cpp:26
void OnDeactivate() override
Override for logic that should run when the scene stops being active.
Definition Scene.cpp:18
void FixedUpdate(float fixedDeltaTime) override
Advances all active, root-level objects on the fixed timestep.
Definition Scene.cpp:34
void OnLoad() override
Override to load scene-specific assets; called once from Load().
Definition Scene.cpp:6
void Update(float deltaTime) override
Advances all active, root-level objects by deltaTime, then steps lighting and physics.
Definition Scene.cpp:30
void OnUnload() override
Override to release scene-specific assets; called from Unload().
Definition Scene.cpp:10
void OnActivate() override
Override for logic that should run when the scene becomes active.
Definition Scene.cpp:14
bool Initialize() override
Runs once before the scene's first Begin()/Update().
Definition Scene.cpp:22
void LateUpdate(float deltaTime) override
Advances all active, root-level objects after the main Update pass.
Definition Scene.cpp:39
Root namespace for everything the engine exposes.
Definition Camera.hpp:10