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
Application.hpp
Go to the documentation of this file.
1
7
8#ifndef GALAXY_CORE_APPLICATION_HPP_
9#define GALAXY_CORE_APPLICATION_HPP_
10
11#include <string>
12#include <functional>
13
14#include <entt/signal/fwd.hpp>
15
16namespace galaxy
17{
18 class Window;
19 class World;
20
24 class App final
25 {
29 using LoopFunc = std::move_only_function<void(entt::dispatcher&, Window&, World&)>;
30
31 public:
40 explicit App(const std::string& config_file = "config.json");
41
45 ~App();
46
50 // void load();
51
55 void run();
56
62 void set_update_func(LoopFunc&& update);
63
69 void set_render_func(LoopFunc&& render);
70
71 private:
75 App(const App&) = delete;
76
80 App(App&&) = delete;
81
85 App& operator=(const App&) = delete;
86
90 App& operator=(App&&) = delete;
91
92 void setup_logging();
93 void setup_async();
94 void setup_config(std::string_view config_file);
95 void setup_platform();
96 void setup_fs();
97 void setup_rendering();
98 void setup_events();
99 // void setup_nuklear();
100 // void setup_loader();
101 void setup_meta();
102 void setup_services();
103 void setup_scripting();
104
105 private:
110
115 };
116} // namespace galaxy
117
118#endif
Base level class for any galaxy app.
App(const App &)=delete
Copy constructor.
std::move_only_function< void(entt::dispatcher &, Window &, World &)> LoopFunc
Defines a callback for update() or render() loops in app.run().
void setup_config(std::string_view config_file)
void run()
Loads the default appdata file.
App(const std::string &config_file="config.json")
Default constructor.
App & operator=(const App &)=delete
Copy assignment operator.
void setup_logging()
void set_render_func(LoopFunc &&render)
Use a custom rendering step in game loop.
void setup_async()
void setup_events()
void setup_rendering()
void setup_meta()
void set_update_func(LoopFunc &&update)
Use a custom update step in game loop.
void setup_services()
App & operator=(App &&)=delete
Move assignment operator.
void setup_scripting()
void setup_platform()
LoopFunc m_render
Render step in gameloop.
~App()
Destructor.
App(App &&)=delete
Move constructor.
LoopFunc m_update
Update step in gameloop.
RAII Window. Handles events, input & display.
Definition Window.hpp:33
Scene, Entity and global game management.
Definition World.hpp:20
Animated.cpp galaxy.
Definition Animated.cpp:16