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 <SDL3/SDL_events.h>
15
16namespace galaxy
17{
21 class App final
22 {
26 using LoopFunc = std::move_only_function<void(App* app)>;
27
28 public:
37 explicit App(const std::string& config_file = "config.json");
38
42 ~App();
43
47 // void load();
48
52 void run();
53
59 void set_update_func(LoopFunc&& update);
60
66 void set_render_func(LoopFunc&& render);
67
73 SDL_Event& events() noexcept;
74
75 private:
79 App(const App&) = delete;
80
84 App(App&&) = delete;
85
89 App& operator=(const App&) = delete;
90
94 App& operator=(App&&) = delete;
95
96 void setup_async();
97 void setup_logging();
98 void setup_config(std::string_view config_file);
99 void setup_platform();
100 void setup_fs();
101 void setup_rendering();
102 void setup_events();
103 void setup_input();
104 // void setup_nuklear();
105 // void setup_loader();
106 void setup_meta();
107 void setup_services();
108 void setup_scripting();
109
110 private:
114 SDL_Event m_events;
115
120
125 };
126} // namespace galaxy
127
128#endif
Base level class for any galaxy app.
void setup_config(std::string_view config_file)
void run()
Loads the default appdata file.
SDL_Event & events() noexcept
Get event data.
App(const std::string &config_file="config.json")
Default constructor.
SDL_Event m_events
Core event data.
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_input()
void setup_rendering()
void setup_meta()
std::move_only_function< void(App *app)> LoopFunc
Defines a callback for update() or render() loops in app.run().
void set_update_func(LoopFunc &&update)
Use a custom update step in game loop.
void setup_services()
void setup_scripting()
void setup_platform()
LoopFunc m_render
Render step in gameloop.
~App()
Destructor.
LoopFunc m_update
Update step in gameloop.
Application.hpp galaxy.
STL namespace.