Loading...
Searching...
No Matches
hellfire::Application Class Reference

#include <Application.h>

Inheritance diagram for hellfire::Application:
Collaboration diagram for hellfire::Application:

Public Member Functions

 Application (int width=800, int height=600, std::string title="hellfire Application")
 
 ~Application () override
 
Shaderensure_fallback_shader ()
 
uint32_t create_minimal_fallback_shader ()
 
void initialize ()
 
void run ()
 
AppInfoget_window_info ()
 
void register_plugin (std::unique_ptr< IApplicationPlugin > plugin)
 Method for registering plugins.
 
void set_exit_condition (std::function< bool()> condition)
 
void request_exit ()
 
bool should_exit () const
 
- Public Member Functions inherited from hellfire::IWindowEventHandler
virtual ~IWindowEventHandler ()=default
 
virtual void on_mouse_wheel (float delta)
 

Protected Member Functions

void on_render () override
 
void on_key_down (int key) override
 
void on_key_up (int key) override
 
void on_mouse_button (int button, bool pressed) override
 
bool handle_first_mouse_movement (float x, float y)
 
void handle_cursor_warping (float x, float y) const
 
void on_mouse_move (float x, float y) override
 
void on_window_resize (int width, int height) override
 
void on_window_minimize (bool minimized) override
 

Private Member Functions

template<typename Func >
void call_plugins (Func &&func)
 
template<typename Func >
bool call_plugins_until_consumed (Func &&func)
 

Private Attributes

std::function< bool()> exit_condition_
 
bool should_exit_ = false
 
std::vector< std::unique_ptr< IApplicationPlugin > > plugins_
 
std::unique_ptr< IWindowwindow_
 
std::unique_ptr< InputManagerinput_manager_
 
ShaderManager shader_manager_
 
ShaderRegistry shader_registry_
 
AppInfo window_info_
 

Detailed Description

Definition at line 43 of file Application.h.

Constructor & Destructor Documentation

◆ Application()

hellfire::Application::Application ( int  width = 800,
int  height = 600,
std::string  title = "hellfire Application" 
)
explicit

Definition at line 9 of file Application.cpp.

◆ ~Application()

hellfire::Application::~Application ( )
override

Definition at line 16 of file Application.cpp.

Member Function Documentation

◆ call_plugins()

template<typename Func >
void hellfire::Application::call_plugins ( Func &&  func)
inlineprivate

Definition at line 108 of file Application.h.

◆ call_plugins_until_consumed()

template<typename Func >
bool hellfire::Application::call_plugins_until_consumed ( Func &&  func)
inlineprivate

Definition at line 115 of file Application.h.

◆ create_minimal_fallback_shader()

uint32_t hellfire::Application::create_minimal_fallback_shader ( )

Definition at line 44 of file Application.cpp.

◆ ensure_fallback_shader()

Shader * hellfire::Application::ensure_fallback_shader ( )

Definition at line 19 of file Application.cpp.

◆ get_window_info()

AppInfo & hellfire::Application::get_window_info ( )
inline

Definition at line 59 of file Application.h.

◆ handle_cursor_warping()

void hellfire::Application::handle_cursor_warping ( float  x,
float  y 
) const
protected

Definition at line 201 of file Application.cpp.

◆ handle_first_mouse_movement()

bool hellfire::Application::handle_first_mouse_movement ( float  x,
float  y 
)
protected

Definition at line 191 of file Application.cpp.

◆ initialize()

void hellfire::Application::initialize ( )

Definition at line 69 of file Application.cpp.

◆ on_key_down()

void hellfire::Application::on_key_down ( int  key)
overrideprotectedvirtual

Reimplemented from hellfire::IWindowEventHandler.

Definition at line 167 of file Application.cpp.

◆ on_key_up()

void hellfire::Application::on_key_up ( int  key)
overrideprotectedvirtual

Reimplemented from hellfire::IWindowEventHandler.

Definition at line 177 of file Application.cpp.

◆ on_mouse_button()

void hellfire::Application::on_mouse_button ( int  button,
bool  pressed 
)
overrideprotectedvirtual

Reimplemented from hellfire::IWindowEventHandler.

Definition at line 181 of file Application.cpp.

◆ on_mouse_move()

void hellfire::Application::on_mouse_move ( float  x,
float  y 
)
overrideprotectedvirtual

Reimplemented from hellfire::IWindowEventHandler.

Definition at line 211 of file Application.cpp.

◆ on_render()

void hellfire::Application::on_render ( )
overrideprotectedvirtual

Reimplemented from hellfire::IWindowEventHandler.

Definition at line 128 of file Application.cpp.

◆ on_window_minimize()

void hellfire::Application::on_window_minimize ( bool  minimized)
overrideprotectedvirtual

Reimplemented from hellfire::IWindowEventHandler.

Definition at line 265 of file Application.cpp.

◆ on_window_resize()

void hellfire::Application::on_window_resize ( int  width,
int  height 
)
overrideprotectedvirtual

Reimplemented from hellfire::IWindowEventHandler.

Definition at line 235 of file Application.cpp.

◆ register_plugin()

void hellfire::Application::register_plugin ( std::unique_ptr< IApplicationPlugin plugin)
inline

Method for registering plugins.

Definition at line 61 of file Application.h.

◆ request_exit()

void hellfire::Application::request_exit ( )

Definition at line 273 of file Application.cpp.

◆ run()

void hellfire::Application::run ( )

Definition at line 102 of file Application.cpp.

◆ set_exit_condition()

void hellfire::Application::set_exit_condition ( std::function< bool()>  condition)

Definition at line 269 of file Application.cpp.

◆ should_exit()

bool hellfire::Application::should_exit ( ) const

Definition at line 277 of file Application.cpp.

Member Data Documentation

◆ exit_condition_

std::function<bool()> hellfire::Application::exit_condition_
private

Definition at line 93 of file Application.h.

◆ input_manager_

std::unique_ptr<InputManager> hellfire::Application::input_manager_
private

Definition at line 99 of file Application.h.

◆ plugins_

std::vector<std::unique_ptr<IApplicationPlugin> > hellfire::Application::plugins_
private

Definition at line 97 of file Application.h.

◆ shader_manager_

ShaderManager hellfire::Application::shader_manager_
private

Definition at line 101 of file Application.h.

◆ shader_registry_

ShaderRegistry hellfire::Application::shader_registry_
private

Definition at line 102 of file Application.h.

◆ should_exit_

bool hellfire::Application::should_exit_ = false
private

Definition at line 94 of file Application.h.

◆ window_

std::unique_ptr<IWindow> hellfire::Application::window_
private

Definition at line 98 of file Application.h.

◆ window_info_

AppInfo hellfire::Application::window_info_
private

Definition at line 105 of file Application.h.


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