SDEngine
Game Engine
Loading...
Searching...
No Matches
GameContext.hpp
Go to the documentation of this file.
1// TODO(docs): Add file-level Doxygen header
2// - @file GameContext.hpp
3// - @brief Interface for game-specific code in hot reload scenarios
4// - How this enables game.dll separation from engine
5#pragma once
6
7#include <string>
8#include <vector>
9
10namespace sd {
11
12class Application;
13class Scene;
14
15// TODO(docs): Document GameContext interface
16// - Purpose: Abstract interface for game code that can be hot-reloaded
17// - Lifecycle: OnLoad -> OnUpdate (loop) -> OnUnload
18// - How to implement a game using this interface
19// - Example minimal game implementation
21public:
22 virtual ~GameContext() = default;
23
24 virtual void on_load(Application& app) = 0;
25 virtual void on_update(float dt) = 0;
26 virtual void on_unload() = 0;
27
28 virtual std::vector<Scene*> get_scenes() = 0;
29};
30
31} // namespace SD
Definition Application.hpp:58
Definition GameContext.hpp:20
virtual void on_load(Application &app)=0
virtual std::vector< Scene * > get_scenes()=0
virtual void on_update(float dt)=0
virtual ~GameContext()=default
virtual void on_unload()=0
Definition Application.hpp:28
constexpr T g_type_max
Definition types.hpp:21