Zen 0.3.0
Loading...
Searching...
No Matches
ZEN_Application.h
1#pragma once
2
3#include <zen/core/ZEN_Core.h>
4#include <zen/core/ZEN_Window.h>
5#include <zen/events/ZEN_Event.h>
6#include <zen/events/ZEN_EventBuffer.h>
7#include <zen/events/ZEN_Events.h>
8#include <zen/gui/ZEN_ImGuiLayer.h>
9#include <zen/inputs/ZEN_InputSystem.h>
10#include <zen/layer/ZEN_LayerList.h>
11#include <zen/renderer/ZEN_Buffer.h>
12#include <zen/renderer/ZEN_GraphicsContext.h>
13#include <zen/renderer/ZEN_Renderer.h>
14#include <zen/renderer/ZEN_Shader.h>
15#include <zen/renderer/ZEN_VertexArray.h>
16#include <zen/zen_pch.h>
17
18namespace Zen {
19 class Application : public EventListener {
20 public:
21 Application();
22 virtual ~Application();
23
24 void run();
25 bool onEvent(const ZenEvent &event) override;
26 void onUpdate(DeltaTime deltaTime);
27
28 void pushLayer(Layer *layer);
29 void pushOverlay(Layer *overlay);
30 void popLayer(Layer *layer);
31 void popOverlay(Layer *overlay);
32
33 static Application &get();
34 Window &getWindow();
35 int getPriority() const override;
36
37 private:
38 static Application *s_instance;
39 std::unique_ptr<Window> m_window;
40 LayerList m_layerList;
41 EventsDispatcher m_eventsDispatcher;
42 bool m_isRunning = true;
43 float m_previousTime = 0.0f;
44
45 EventBuffer m_eventBuffer{512};
46 InputSystem m_inputSystem;
47 ImGuiLayer *m_ImGui = nullptr;
48 };
49
50 // Defined Client Side
51 Application *CreateApplication();
52}; // namespace Zen