40 [[nodiscard]]
static std::expected<void, CoriError<>>
PushLayer(
Layer* layer);
51 [[nodiscard]]
static std::expected<void, CoriError<>>
PushOverlay(
Layer* overlay);
102 template <
class F,
class... Args>
103 static std::future<std::invoke_result_t<F, Args...>>
SubmitMainTask(F&& f, Args&&... args) {
104 return s_Instance->m_CommandQueue.Submit(std::forward<F>(f), std::forward<Args>(args)...);
116 template <
class F,
class... Args>
117 static std::future<std::invoke_result_t<F, Args...>>
SubmitWorkerTask(F&& f, Args&&... args) {
118 return s_Instance->m_WorkerPool.Submit(std::forward<F>(f), std::forward<Args>(args)...);
128 void OnEvent(
Event& event);
130 void TickrateUpdate(
GameTimer& gameTimer);
132 bool OnWindowClose();
134 bool m_RenderImGui{
true };
136 std::unique_ptr<Window> m_Window;
138 Internal::ImGuiLayer* m_ImGuiLayer;
140 LayerStack m_LayerStack;
142 Threading::MainThreadQueue m_CommandQueue;
144 Threading::ThreadPool m_WorkerPool;
146 GameTimer m_GameTimer;
148 bool m_Running{
true };
152 glm::vec4 m_BackgroundColor{ 0.5f, 0.5f, 0.0f, 1.0f };
Main Application object, there can only be one Application object. Basically a root of the program.
static void PopOverlay()
Pops the overlay Layer from the LayerStack.
static void EmitEvent(Event &event)
Emits the event and propagates it thought the LayerStack.
Application(const char *windowName)
static std::future< std::invoke_result_t< F, Args... > > SubmitMainTask(F &&f, Args &&... args)
Submits a task to be executed on the main thread.
static GameTimer & GetGameTimer()
Getter for the GameTimer.
static void SetBackgroundColor(const glm::vec4 &color)
Setts the background color of the rendering canvas.
static std::expected< void, CoriError<> > PushLayer(Layer *layer)
Pushes a Layer to the LayerStack.
static void PopLayer()
Pops the Layer from the LayerStack.
void Run()
Run loop, internal.
static std::expected< void, CoriError<> > PushOverlay(Layer *overlay)
Pushes an overlay Layer to the LayerStack.
static Window & GetWindow()
Getter for the main Window.
static std::future< std::invoke_result_t< F, Args... > > SubmitWorkerTask(F &&f, Args &&... args)
Submits a task to be executed on the worker thread.
static uint16_t GetWorkerCount()
Returns a number of available worker threads.
An abstract class that is ment to be used as a template for defining events.
A GameTimer is responsible for managing everything that is connected with time, ticks,...
An abstract class that is ment to be used as a template for defining layers.
This class manages everything that is connected with physical Window management, i might add multiwin...
Core systems of the engine are here.
Application * CreateApplication()