#include <Application.hpp>
Definition at line 28 of file Application.hpp.
◆ Application()
Application constructor
- Parameters
-
window_settings | Window settings struct to setup window's initial width, height, title... |
◆ ~Application()
Application::~Application |
( |
| ) |
|
|
override |
◆ EndApplication()
void Application::EndApplication |
( |
| ) |
|
|
noexcept |
Ends Application by exiting the main loop by setting window should close to true
◆ Exit()
void Application::Exit |
( |
const std::string & |
message, |
|
|
const std::int32_t |
exit_code |
|
) |
| |
|
noexcept |
Immediate exit from application without waiting for GL flushes or scenes to be destroyed.
- Parameters
-
message | reason of exiting |
exit_code | exit code e.g EXIT_FAILURE |
◆ GetCPUInfo()
constexpr const std::unique_ptr<CPUInfo>& Application::GetCPUInfo |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Returns Realtime CPU usage informations (if enabled in WindowSettings.ini, otherwise nullptr)
Definition at line 92 of file Application.hpp.
◆ GetDeltaTime()
float Application::GetDeltaTime |
( |
| ) |
const |
|
inlinenoexcept |
Returns delta time value (the time difference between the previous frame the current frame)
Definition at line 86 of file Application.hpp.
◆ GetFPS()
std::uint32_t Application::GetFPS |
( |
| ) |
const |
|
inlinenoexcept |
Returns FPS (Frames Per Second) (if enabled in WindowSettings.ini, otherwise 0)
Definition at line 83 of file Application.hpp.
◆ getInstance()
◆ GetRAMInfo()
constexpr const std::unique_ptr<RAMInfo>& Application::GetRAMInfo |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Returns Realtime RAM usage informations (if enabled in WindowSettings.ini, otherwise nullptr)
Definition at line 89 of file Application.hpp.
◆ GetWindow()
const std::unique_ptr<Window>& Application::GetWindow |
( |
| ) |
const |
|
inlinenoexcept |
◆ LaunchWorkerThread()
void Application::LaunchWorkerThread |
( |
Scene * |
scene, |
|
|
const std::string & |
loading_text, |
|
|
const std::function< void()> & |
work_func |
|
) |
| |
Launches detached thread seperated from main UI thread.
- Parameters
-
loading_text | the reason behind launching this worker thread, will appear bellow loading spinner e.g: "Encrypting file..." |
scene | pointer to scene which spawns the worker thread |
work_func | function has work code to run in parallel |
◆ OnEvent()
void Application::OnEvent |
( |
Event & |
event | ) |
|
Event callbacks.
- Parameters
-
event | event that was dispatched |
- Returns
- true if event is handled, false to pass it to other scenes
- See also
- Event.hpp
◆ OnFrameBufferResize()
◆ OnWindowClose()
◆ OnWindowResize()
◆ PushScene()
void Application::PushScene |
( |
std::unique_ptr< Scene > |
scene | ) |
|
Pushes new Scene to the stack Calls scene life cycle OnCreate()
◆ Run()
void Application::Run |
( |
| ) |
|
The documentation for this class was generated from the following file: