Main Application object, there can only be one Application object. Basically a root of the program.
More...
#include <Application.hpp>
Main Application object, there can only be one Application object. Basically a root of the program.
Definition at line 23 of file Application.hpp.
◆ Application()
| Cori::Core::Application::Application |
( |
const char * | windowName | ) |
|
|
explicit |
◆ ~Application()
| Cori::Core::Application::~Application |
( |
| ) |
|
|
virtual |
◆ EmitEvent()
| void Cori::Core::Application::EmitEvent |
( |
Event & | event | ) |
|
|
static |
◆ GetGameTimer()
| GameTimer & Cori::Core::Application::GetGameTimer |
( |
| ) |
|
|
inlinestatic |
◆ GetWindow()
| Window & Cori::Core::Application::GetWindow |
( |
| ) |
|
|
inlinestatic |
◆ GetWorkerCount()
| uint16_t Cori::Core::Application::GetWorkerCount |
( |
| ) |
|
|
static |
Returns a number of available worker threads.
- Returns
- Worker threads count.
Definition at line 55 of file Application.cpp.
◆ PopLayer()
| void Cori::Core::Application::PopLayer |
( |
| ) |
|
|
static |
◆ PopOverlay()
| void Cori::Core::Application::PopOverlay |
( |
| ) |
|
|
static |
Pops the overlay Layer from the LayerStack.
The overlay Layer to be popped is the last that was pushed to the LayerStack. If there is nothing to pop, nothing will happen.
- Note
- All operations with the LayerStack are processed at the end of the frame.
Definition at line 95 of file Application.cpp.
◆ PushLayer()
| std::expected< void, CoriError<> > Cori::Core::Application::PushLayer |
( |
Layer * | layer | ) |
|
|
staticnodiscard |
◆ PushOverlay()
| std::expected< void, CoriError<> > Cori::Core::Application::PushOverlay |
( |
Layer * | overlay | ) |
|
|
staticnodiscard |
Pushes an overlay Layer to the LayerStack.
- Parameters
-
| overlay | Rawptr to the created overlay Layer. |
LayerStack manages the lifetime of the overlay Layer. Overlay Layers are always on the top of the LayerStack and always above regular Layers, thus are updated before regular Layers. Duplicate Layer names are forbidden and will result in a CoriError.
- Note
- All operations with the LayerStack are processed at the end of the frame.
- Returns
- Expected object with void on success or CoriError<> on failure.
Definition at line 87 of file Application.cpp.
◆ Run()
| void Cori::Core::Application::Run |
( |
| ) |
|
◆ SetBackgroundColor()
| void Cori::Core::Application::SetBackgroundColor |
( |
const glm::vec4 & | color | ) |
|
|
static |
Setts the background color of the rendering canvas.
- Parameters
-
| color | Normalized RGBA color. |
Definition at line 99 of file Application.cpp.
◆ SubmitMainTask()
template<class F, class... Args>
| std::future< std::invoke_result_t< F, Args... > > Cori::Core::Application::SubmitMainTask |
( |
F && | f, |
|
|
Args &&... | args ) |
|
inlinestatic |
Submits a task to be executed on the main thread.
Submitted tasks will be processed in the very beginning of the next frame.
It is safe to call this function from any thread.
- Template Parameters
-
| F | Auto deduced callable type. |
| Args | Auto deduced callable argument types. |
- Parameters
-
| f | Task callable, no specific signature required. |
| args | Arguments that will be passed to the callable task upon execution. |
- Returns
- Future that will hold the result of invoke result of the passed callable.
Definition at line 103 of file Application.hpp.
◆ SubmitWorkerTask()
template<class F, class... Args>
| std::future< std::invoke_result_t< F, Args... > > Cori::Core::Application::SubmitWorkerTask |
( |
F && | f, |
|
|
Args &&... | args ) |
|
inlinestatic |
Submits a task to be executed on the worker thread.
It is safe to call this function from any thread.
- Template Parameters
-
| F | Auto deduced callable type. |
| Args | Auto deduced callable argument types. |
- Parameters
-
| f | Task callable, no specific signature required. |
| args | Arguments that will be passed to the callable task upon execution. |
- Returns
- Future that will hold the result of invoke result of the passed callable.
Definition at line 117 of file Application.hpp.
The documentation for this class was generated from the following files: