galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
Scene.hpp
Go to the documentation of this file.
1
7
8#ifndef GALAXY_SCENE_SCENE_HPP_
9#define GALAXY_SCENE_SCENE_HPP_
10
11#include <entt/signal/dispatcher.hpp>
12
13#include <SDL3/SDL_events.h>
14
17
18namespace galaxy
19{
26 class Scene final : public State
27 {
28 public:
34 Scene(const std::string& name) noexcept;
35
39 virtual ~Scene() noexcept;
40
44 void on_push() override;
45
49 void on_pop() override;
50
56 void on_event(SDL_Event& event);
57
63 void update(EntityManager& em);
64
68 void render();
69
75 [[nodiscard]]
76 SystemManager& sys_man() noexcept;
77
78 private:
82 Scene() = delete;
83
87 Scene(const Scene&) = delete;
88
92 Scene& operator=(const Scene&) = delete;
93
94 private:
99
103 entt::dispatcher m_dispatcher;
104 };
105} // namespace galaxy
106
107/*
111void update_ui();
112
116 void only_update_rendering();
117
125[[nodiscard]]
126bool load_world(const std::string& file);
132[[nodiscard]]
133nlohmann::json serialize() override;
134
140void deserialize(const nlohmann::json& json) override;
144graphics::Camera m_camera;
145
146
150b2World m_b2world;
151
155map::World m_world;
156
160int m_velocity_iterations;
161
165int m_position_iterations;
166
170 std::size_t m_rendersystem_index;
171*/
172
173#endif
Class for making creating and managing entities easier.
Represents a scene in a game.
Definition Scene.hpp:27
void on_push() override
When scene is pushed to the stack.
Definition Scene.cpp:46
Scene(const Scene &)=delete
Copy constructor.
virtual ~Scene() noexcept
Destructor.
Definition Scene.cpp:42
Scene & operator=(const Scene &)=delete
Copy assignment operator.
void update(EntityManager &em)
Process events and updates.
Definition Scene.cpp:250
void on_pop() override
When scene is popped from the stack.
Definition Scene.cpp:50
void on_event(SDL_Event &event)
Handle an event for a scene.
Definition Scene.cpp:58
entt::dispatcher m_dispatcher
Scene event handler.
Definition Scene.hpp:103
SystemManager m_sysman
Systems only used by this scene.
Definition Scene.hpp:98
void render()
Render scene.
Definition Scene.cpp:261
SystemManager & sys_man() noexcept
Get system manager.
Definition Scene.cpp:289
Scene()=delete
Constructor.
A state to use in a finite state machine.
Definition State.hpp:19
const std::string & name() const noexcept
Get state name.
Definition State.cpp:17
Manages the systems assigned to it.
Application.hpp galaxy.