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
10
namespace
sd
{
11
12
class
Application;
13
class
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
20
class
GameContext
{
21
public
:
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
sd::Application
Definition
Application.hpp:58
sd::GameContext
Definition
GameContext.hpp:20
sd::GameContext::on_load
virtual void on_load(Application &app)=0
sd::GameContext::get_scenes
virtual std::vector< Scene * > get_scenes()=0
sd::GameContext::on_update
virtual void on_update(float dt)=0
sd::GameContext::~GameContext
virtual ~GameContext()=default
sd::GameContext::on_unload
virtual void on_unload()=0
sd
Definition
Application.hpp:28
g_type_max
constexpr T g_type_max
Definition
types.hpp:21
SD
include
SD
GameContext.hpp
Generated by
1.9.8