SDEngine
Game Engine
Loading...
Searching...
No Matches
sd::Application Class Reference

#include <Application.hpp>

+ Collaboration diagram for sd::Application:

Public Types

using ViewResult = ViewManager::ViewResult
 

Public Member Functions

 Application (const ApplicationSpecification &spec, RuntimeStateManager *state_manager=nullptr)
 
virtual ~Application ()
 
 Application (const Application &)=delete
 
Applicationoperator= (const Application &)=delete
 
 Application (Application &&)=delete
 
Applicationoperator= (Application &&)=delete
 
void run (const std::atomic< bool > *external_stop)
 
void frame ()
 
void close ()
 
void on_app_event (Event &e)
 
template<typename T , typename... Args>
requires std::is_base_of_v<Layer, T>
T & push_global_layer (Args &&... args)
 
WindowId create_window (const WindowProps &props)
 
Windowget_window (const WindowId id) const
 
VulkanWindowget_render_window (const WindowId id) const
 
template<typename T , typename... Args>
requires std::is_base_of_v<Layer, T>
T & push_view_layer (WindowId id, Args &&... args)
 
template<typename T , typename... Args>
requires std::is_base_of_v<View, T>
T & create_view (std::string name, Args &&... args)
 
ViewResult get_view (const ViewId id) const
 
ViewResult get_view (const std::string &name) const
 
std::expected< ViewId, ViewErrorget_view_id (const std::string &name) const
 
ViewError remove_view (ViewId id)
 
ViewError remove_view (const std::string &name)
 
template<typename T , typename... Args>
requires std::is_base_of_v<Layer, T>
std::expected< std::reference_wrapper< T >, ViewErrorpush_layer_to_view (ViewId id, Args &&... args)
 
template<typename T , typename... Args>
requires std::is_base_of_v<Layer, T>
std::expected< std::reference_wrapper< T >, ViewErrorpush_layer_to_view (const std::string &name, Args &&... args)
 
Scenecreate_scene (const std::string &name)
 
Sceneget_scene (const std::string &name) const
 
void clear_game_layers ()
 
void reload_game ()
 
void reload_shaders () const
 
EngineServices services () const
 
ApplicationRuntime runtime ()
 

Public Attributes

bool is_running = true
 
bool hot_reload_enabled = true
 
float hot_reload_timer = 0.0f
 
ApplicationSpecification app_spec
 
std::unique_ptr< WindowManagerwindow_manager
 
std::unique_ptr< ViewManagerview_manager
 
std::unique_ptr< LayoutManagerlayout_manager
 
SceneManager scene_manager
 
LayerList global_layers
 
EventManager app_event_manager
 
GameContextgame_context = nullptr
 
RuntimeStateManagerstate_manager
 
FrameTimer timer
 

Private Attributes

std::unique_ptr< GlfwContextm_glfw_ctx
 
std::unique_ptr< VulkanContextm_vulkan_ctx
 
std::unique_ptr< VulkanRendererm_renderer
 
std::unique_ptr< SDImGuiContextm_imgui_ctx
 
voidm_game_handle = nullptr
 

Member Typedef Documentation

◆ ViewResult

Constructor & Destructor Documentation

◆ Application() [1/3]

sd::Application::Application ( const ApplicationSpecification spec,
RuntimeStateManager state_manager = nullptr 
)
explicit

◆ ~Application()

sd::Application::~Application ( )
virtual

◆ Application() [2/3]

sd::Application::Application ( const Application )
delete

◆ Application() [3/3]

sd::Application::Application ( Application &&  )
delete

Member Function Documentation

◆ clear_game_layers()

void sd::Application::clear_game_layers ( )

◆ close()

void sd::Application::close ( )
inline

◆ create_scene()

Scene * sd::Application::create_scene ( const std::string &  name)
inline

◆ create_view()

template<typename T , typename... Args>
requires std::is_base_of_v<View, T>
T & sd::Application::create_view ( std::string  name,
Args &&...  args 
)
inline

◆ create_window()

WindowId sd::Application::create_window ( const WindowProps props)
inline

◆ frame()

void sd::Application::frame ( )

◆ get_render_window()

VulkanWindow & sd::Application::get_render_window ( const WindowId  id) const
inline

◆ get_scene()

Scene * sd::Application::get_scene ( const std::string &  name) const
inline

◆ get_view() [1/2]

ViewResult sd::Application::get_view ( const std::string &  name) const
inline

◆ get_view() [2/2]

ViewResult sd::Application::get_view ( const ViewId  id) const
inline

◆ get_view_id()

std::expected< ViewId, ViewError > sd::Application::get_view_id ( const std::string &  name) const
inline

◆ get_window()

Window & sd::Application::get_window ( const WindowId  id) const
inline

◆ on_app_event()

void sd::Application::on_app_event ( Event e)

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ push_global_layer()

template<typename T , typename... Args>
requires std::is_base_of_v<Layer, T>
T & sd::Application::push_global_layer ( Args &&...  args)
inline

◆ push_layer_to_view() [1/2]

template<typename T , typename ... Args>
requires std::is_base_of_v<Layer, T>
std::expected< std::reference_wrapper< T >, ViewError > sd::Application::push_layer_to_view ( const std::string &  name,
Args &&...  args 
)

◆ push_layer_to_view() [2/2]

template<typename T , typename ... Args>
requires std::is_base_of_v<Layer, T>
std::expected< std::reference_wrapper< T >, ViewError > sd::Application::push_layer_to_view ( ViewId  id,
Args &&...  args 
)

◆ push_view_layer()

template<typename T , typename ... Args>
requires std::is_base_of_v<Layer, T>
T & sd::Application::push_view_layer ( WindowId  id,
Args &&...  args 
)

◆ reload_game()

void sd::Application::reload_game ( )

◆ reload_shaders()

void sd::Application::reload_shaders ( ) const

◆ remove_view() [1/2]

ViewError sd::Application::remove_view ( const std::string &  name)
inline

◆ remove_view() [2/2]

ViewError sd::Application::remove_view ( ViewId  id)
inline

◆ run()

void sd::Application::run ( const std::atomic< bool > *  external_stop)

◆ runtime()

ApplicationRuntime sd::Application::runtime ( )
inline

◆ services()

EngineServices sd::Application::services ( ) const
inline

Member Data Documentation

◆ app_event_manager

EventManager sd::Application::app_event_manager

◆ app_spec

ApplicationSpecification sd::Application::app_spec

◆ game_context

GameContext* sd::Application::game_context = nullptr

◆ global_layers

LayerList sd::Application::global_layers

◆ hot_reload_enabled

bool sd::Application::hot_reload_enabled = true

◆ hot_reload_timer

float sd::Application::hot_reload_timer = 0.0f

◆ is_running

bool sd::Application::is_running = true

◆ layout_manager

std::unique_ptr<LayoutManager> sd::Application::layout_manager

◆ m_game_handle

void* sd::Application::m_game_handle = nullptr
private

◆ m_glfw_ctx

std::unique_ptr<GlfwContext> sd::Application::m_glfw_ctx
private

◆ m_imgui_ctx

std::unique_ptr<SDImGuiContext> sd::Application::m_imgui_ctx
private

◆ m_renderer

std::unique_ptr<VulkanRenderer> sd::Application::m_renderer
private

◆ m_vulkan_ctx

std::unique_ptr<VulkanContext> sd::Application::m_vulkan_ctx
private

◆ scene_manager

SceneManager sd::Application::scene_manager

◆ state_manager

RuntimeStateManager* sd::Application::state_manager

◆ timer

FrameTimer sd::Application::timer

◆ view_manager

std::unique_ptr<ViewManager> sd::Application::view_manager

◆ window_manager

std::unique_ptr<WindowManager> sd::Application::window_manager

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