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
13
14namespace galaxy
15{
22 class Scene final : public State
23 {
24 public:
30 Scene(const std::string& name) noexcept;
31
35 virtual ~Scene();
36
40 void on_push() override;
41
45 void on_pop() override;
46
52 void update(Registry& registry);
53
57 void render();
58
62 void clear();
63
71 void add_system(const std::string& system);
72
73 private:
77 Scene() = delete;
78
82 Scene(const Scene&) = delete;
83
87 Scene& operator=(const Scene&) = delete;
88
89 private:
94 };
95} // namespace galaxy
96
97/*
101void update_ui();
102
106 void only_update_rendering();
107
115[[nodiscard]]
116bool load_world(const std::string& file);
122[[nodiscard]]
123nlohmann::json serialize() override;
124
130void deserialize(const nlohmann::json& json) override;
134graphics::Camera m_camera;
135
139entt::dispatcher m_dispatcher;
140
144b2World m_b2world;
145
149map::World m_world;
150
154int m_velocity_iterations;
155
159int m_position_iterations;
160
164 std::size_t m_rendersystem_index;
165*/
166
167#endif
Wrapper around entt::registry to expand functionality.
Definition Registry.hpp:19
Represents a scene in a game.
Definition Scene.hpp:23
void on_push() override
When scene is pushed to the stack.
Definition Scene.cpp:36
SystemStack m_systems
List of systems to process.
Definition Scene.hpp:93
Scene(const Scene &)=delete
Copy constructor.
Scene & operator=(const Scene &)=delete
Copy assignment operator.
void on_pop() override
When scene is popped from the stack.
Definition Scene.cpp:40
void clear()
Remove all scene data.
Definition Scene.cpp:84
virtual ~Scene()
Destructor.
Definition Scene.cpp:31
void add_system(const std::string &system)
Add a system to operate on entities in this scene.
Definition Scene.cpp:89
void render()
Render scene.
Definition Scene.cpp:59
void update(Registry &registry)
Process events and updates.
Definition Scene.cpp:48
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
Animated.cpp galaxy.
Definition Animated.cpp:16
std::vector< std::shared_ptr< System > > SystemStack
System stack typedef.