cae  0.0.0
Cross-API graphics engine
Loading...
Searching...
No Matches
cae::Application Class Reference

Main class. More...

#include <Application.hpp>

+ Collaboration diagram for cae::Application:

Public Member Functions

 Application (const ArgsConfig &argsConfig, const EnvConfig &envConfig)
 Construct the Application with given configurations.
 
 ~Application ()=default
 
 Application (const Application &)=delete
 
Applicationoperator= (const Application &)=delete
 
 Application (Application &&)=delete
 
Applicationoperator= (Application &&)=delete
 
void start ()
 Start the application.
 
void stop ()
 Stop the application.
 

Private Member Functions

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.
 
void mainLoop ()
 main loop
 

Static Private Member Functions

static EngineConfig parseEngineConf (const std::string &path)
 Parse the engine configuration file.
 

Private Attributes

std::unique_ptr< utl::PluginLoaderm_pluginLoader = nullptr
 
std::unique_ptr< Enginem_engine = nullptr
 
AppConfig m_appConfig
 
std::unordered_map< KeyCode, bool > m_keyState
 

Detailed Description

Main class.

Definition at line 33 of file Application.hpp.

Constructor & Destructor Documentation

◆ Application() [1/3]

cae::Application::Application ( const ArgsConfig & argsConfig,
const EnvConfig & envConfig )

Construct the Application with given configurations.

Parameters
argsConfigCommand line arguments configuration
envConfigEnvironment variables configuration

Definition at line 43 of file application.cpp.

References cae::ArgsConfig::config_path, cae::AppConfig::engineConfig, cae::AppConfig::envConfig, cae::PLUGINS::NAME::WINDOW::GLFW, cae::PLUGINS::NAME::SHADER::FRONTEND::GLSL, utl::INFO, utl::Logger::log(), m_appConfig, cae::PLUGINS::NAME::RENDERER::OPENGL, parseEngineConf(), setupEngine(), cae::PLUGINS::NAME::SHADER::IR::SPIRV, cae::MESSAGE::VERSION_MSG, and utl::WARNING.

+ Here is the call graph for this function:

◆ ~Application()

cae::Application::~Application ( )
default

◆ Application() [2/3]

cae::Application::Application ( const Application & )
delete

◆ Application() [3/3]

cae::Application::Application ( Application && )
delete

Member Function Documentation

◆ mainLoop()

void cae::Application::mainLoop ( )
private

main loop

Definition at line 167 of file application.cpp.

References cae::A, cae::D, cae::Down, cae::KeyDown, cae::KeyUp, cae::LCtrl, cae::Left, cae::Right, cae::S, cae::Space, cae::Up, and cae::W.

◆ operator=() [1/2]

Application & cae::Application::operator= ( Application && )
delete

◆ operator=() [2/2]

Application & cae::Application::operator= ( const Application & )
delete

◆ parseEngineConf()

◆ setupEngine()

void cae::Application::setupEngine ( const std::string & rendererName,
const std::string & windowName,
const std::string & shaderFrontendName,
const std::string & shaderIRName )
private

Setup the engine with the given plugins.

Parameters
rendererNamerenderer plugin name
windowNamewindow plugin name
shaderFrontendNameshader frontend plugin name
shaderIRNameshader IR plugin name

Definition at line 65 of file application.cpp.

References loadPlugins(), utl::Logger::log(), and utl::WARNING.

Referenced by Application().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ start()

void cae::Application::start ( )

Start the application.

Definition at line 142 of file application.cpp.

References cubeVertices, utl::fileToString(), cae::FRAGMENT, cae::GLSL, utl::Path::resolveRelativeToExe(), and cae::VERTEX.

+ Here is the call graph for this function:

◆ stop()

void cae::Application::stop ( )

Stop the application.

Definition at line 159 of file application.cpp.

Member Data Documentation

◆ m_appConfig

AppConfig cae::Application::m_appConfig
private

Definition at line 86 of file Application.hpp.

Referenced by Application().

◆ m_engine

std::unique_ptr<Engine> cae::Application::m_engine = nullptr
private

Definition at line 84 of file Application.hpp.

◆ m_keyState

std::unordered_map<KeyCode, bool> cae::Application::m_keyState
private

Definition at line 87 of file Application.hpp.

◆ m_pluginLoader

std::unique_ptr<utl::PluginLoader> cae::Application::m_pluginLoader = nullptr
private

Definition at line 83 of file Application.hpp.


The documentation for this class was generated from the following files: