cae  0.0.0
Cross-API graphics engine
Loading...
Searching...
No Matches
Application.hpp
Go to the documentation of this file.
1///
2/// @file Application.hpp
3/// @brief This file contains the Application class declaration
4/// @namespace cae
5///
6
7#pragma once
8
9#include "CAE/ArgsHandler.hpp"
10
11#include "Engine/Engine.hpp"
13
14namespace cae
15{
16
17 ///
18 /// @struct AppConfig
19 /// @brief Struct for application configuration
20 /// @namespace cae
21 ///
27
28 ///
29 /// @class Application
30 /// @brief Main class
31 /// @namespace cae
32 ///
34 {
35
36 public:
37 ///
38 /// @param argsConfig Command line arguments configuration
39 /// @param envConfig Environment variables configuration
40 /// @brief Construct the Application with given configurations
41 ///
42 Application(const ArgsConfig &argsConfig, const EnvConfig &envConfig);
43 ~Application() = default;
44
45 Application(const Application &) = delete;
46 Application &operator=(const Application &) = delete;
49
50 ///
51 /// @brief Start the application
52 ///
53 void start();
54
55 ///
56 /// @brief Stop the application
57 ///
58 void stop();
59
60 private:
61 ///
62 /// @param rendererName renderer plugin name
63 /// @param windowName window plugin name
64 /// @param shaderFrontendName shader frontend plugin name
65 /// @param shaderIRName shader IR plugin name
66 /// @brief Setup the engine with the given plugins
67 ///
68 void setupEngine(const std::string &rendererName, const std::string &windowName,
69 const std::string &shaderFrontendName, const std::string &shaderIRName);
70
71 ///
72 /// @param path Path to the engine configuration file
73 /// @return Parsed EngineConfig
74 /// @brief Parse the engine configuration file
75 ///
76 static EngineConfig parseEngineConf(const std::string &path);
77
78 ///
79 /// @brief main loop
80 ///
81 void mainLoop();
82
83 std::unique_ptr<utl::PluginLoader> m_pluginLoader = nullptr;
84 std::unique_ptr<Engine> m_engine = nullptr;
85
87 std::unordered_map<KeyCode, bool> m_keyState;
88
89 }; // class Application
90
91} // namespace cae
This file contains the ArgsHandler class declaration.
This file contains the engine class declaration.
Modern, cross-platform plugin loader.
AppConfig m_appConfig
Application(const ArgsConfig &argsConfig, const EnvConfig &envConfig)
Construct the Application with given configurations.
void mainLoop()
main loop
static EngineConfig parseEngineConf(const std::string &path)
Parse the engine configuration file.
Definition conf.cpp:12
Application(Application &&)=delete
Application(const Application &)=delete
std::unique_ptr< utl::PluginLoader > m_pluginLoader
std::unique_ptr< Engine > m_engine
void setupEngine(const std::string &rendererName, const std::string &windowName, const std::string &shaderFrontendName, const std::string &shaderIRName)
Setup the engine with the given plugins.
~Application()=default
void start()
Start the application.
std::unordered_map< KeyCode, bool > m_keyState
Application & operator=(const Application &)=delete
Application & operator=(Application &&)=delete
void stop()
Stop the application.
Struct for application configuration.
EnvConfig envConfig
EngineConfig engineConfig
Struct for command line arguments configuration.
Struct for engine configuration.
Definition Engine.hpp:28
Struct for environment variables configuration.