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 <SFML/Window/Cursor.hpp>
12
13#if _WIN32 || _WIN64
14extern "C"
15{
16 // http://developer.amd.com/community/blog/2015/10/02/amd-enduro-system-for-developers/
17 // http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf
18
19 inline __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
20 inline __declspec(dllexport) std::uint32_t NvOptimusEnablement = 0x00000001;
21}
22#elif
23{
24 inline int AmdPowerXpressRequestHighPerformance = 1;
25 inline std::uint32_t NvOptimusEnablement = 0x00000001;
26}
27#endif
28
29namespace sf
30{
31 class RenderWindow;
32} // namespace sf
33
34namespace galaxy
35{
36 namespace core
37 {
41 class App final
42 {
43 public:
53 explicit App(std::string_view log_dir, std::string_view config_file);
54
58 ~App();
59
63 void load();
64
68 void run();
69
70 private:
74 App(const App&) = delete;
75
79 App(App&&) = delete;
80
84 App& operator=(const App&) = delete;
85
89 App& operator=(App&&) = delete;
90
91 void setup_platform();
92 void setup_logging(std::string_view log_dir);
93 void setup_async();
94 void setup_config(std::string_view config_file);
95 void setup_fs();
96 void setup_window();
97 void setup_events();
98 void setup_nuklear();
99 void setup_loader();
100 void setup_meta();
101 void setup_scripting();
102 void setup_services();
103
104 void handle_events(sf::RenderWindow& window);
105
106 private:
110 std::optional<sf::Cursor> m_cursor;
111 };
112 } // namespace core
113} // namespace galaxy
114
115#endif
Base level class for any galaxy app.
void run()
Runs the app.
App(const App &)=delete
Copy constructor.
~App()
Destructor.
App & operator=(App &&)=delete
Move assignment operator.
void setup_config(std::string_view config_file)
void setup_logging(std::string_view log_dir)
void load()
Loads the default appdata file.
std::optional< sf::Cursor > m_cursor
SFML cursor handle. Needs to be kept in memory.
App(App &&)=delete
Move constructor.
void handle_events(sf::RenderWindow &window)
App & operator=(const App &)=delete
Copy assignment operator.
App(std::string_view log_dir, std::string_view config_file)
Default constructor.
Timer.hpp galaxy.
Definition Async.hpp:17
Application.hpp galaxy.