19 const std::function<std::shared_ptr<INetwork>()> &networkFactory,
20 const std::function<std::shared_ptr<IRenderer>()> &rendererFactory,
21 const std::function<std::shared_ptr<IShaderIR>()> &shaderIRFactory,
22 const std::vector<std::function<std::shared_ptr<IShaderFrontend>()>> &shaderFrontendFactories,
23 const std::function<std::shared_ptr<IWindow>()> &windowFactory)
24 : m_audioPlugin(audioFactory()), m_networkPlugin(networkFactory()), m_rendererPlugin(rendererFactory()),
25 m_windowPlugin(windowFactory()), m_clock(std::make_unique<
utl::Clock>()),
26 m_shaderManager(std::make_unique<
ShaderManager>(shaderFrontendFactories, shaderIRFactory)),
27 m_camera(std::make_unique<
Camera>(config.camera_position, config.camera_rotation, config.camera_direction,
28 config.camera_move_speed, config.camera_look_speed, config.camera_fov,
29 config.camera_near_plane, config.camera_far_plane)),
30 m_logFps(config.log_fps)
32 constexpr auto boolToStr = [](
const bool b) {
return b ?
"true" :
"false"; };
33 std::ostringstream msg;
34 msg <<
"Starting engine with configuration:\n"
36 <<
"\tAudio muted: " << boolToStr(config.
audio_muted) <<
"\n"
37 <<
"\tLog FPS: " << boolToStr(config.
log_fps) <<
"\n"
40 <<
"\tRenderer vsync: " << boolToStr(config.
renderer_vsync) <<
"\n"
Engine(const EngineConfig &config, const std::function< std::shared_ptr< IAudio >()> &audioFactory, const std::function< std::shared_ptr< INetwork >()> &networkFactory, const std::function< std::shared_ptr< IRenderer >()> &rendererFactory, const std::function< std::shared_ptr< IShaderIR >()> &shaderIRFactory, const std::vector< std::function< std::shared_ptr< IShaderFrontend >()> > &shaderFrontendFactories, const std::function< std::shared_ptr< IWindow >()> &windowFactory)