ImagoEngine
A C++ 2D game engine built on a sparse-set ECS, with scenes, scheduled systems, events, and action-based input
Loading...
Searching...
No Matches
SceneContext.hpp
Go to the documentation of this file.
1
6
7#pragma once
8
9// NOTE: since SceneContext only stores pointers we just need to do forward declarations instead of full types
10// to avoid circular includes and make the .hpp file cheaper
11namespace sf { class RenderWindow; }
12namespace Imago::ECS { class Nexus; }
13
14namespace Imago::Engine
15{
16 // internal forward declarations
17 class AssetManager;
18 class Broadcaster;
19 class EngineControl;
20 class InputState;
21
30 struct SceneContext {
31 ECS::Nexus* nexus = nullptr;
33 EngineControl* engine = nullptr;
34 InputState* input = nullptr;
35 AssetManager* assets = nullptr;
36 sf::RenderWindow* window = nullptr;
37 };
38}
the Nexus is the brain of the ECS world. It is the object the user will use to interact with everythi...
Definition Nexus.hpp:84
Broadcaster acts as ImagoEngine's event system. It lets systems communicate without knowing about eac...
Definition Broadcaster.hpp:70
The user's only way to talk to the Game from inside a system or Scene load/unload.
Definition EngineControl.hpp:20
What systems query for input (ctx.input->began("jump")). This is only for querying....
Definition InputState.hpp:29
Gives systems access to the persistent engine objects they could need.
Definition SceneContext.hpp:30
EngineControl * engine
how systems send requests to the Game (switch_scene and quit)
Definition SceneContext.hpp:33
ECS::Nexus * nexus
the active Scene's nexus
Definition SceneContext.hpp:31
sf::RenderWindow * window
the render window, owned by the Game
Definition SceneContext.hpp:36
Broadcaster * broadcaster
the active Scene's broadcaster
Definition SceneContext.hpp:32
InputState * input
how users query for actions
Definition SceneContext.hpp:34
AssetManager * assets
the loaded assets, owned by the Game
Definition SceneContext.hpp:35