Karma Engine
Loading...
Searching...
No Matches
KarmaGuiLayer.h
1#pragma once
2
3#include "krpch.h"
4
5#include "Layer.h"
6#include "Events/KeyEvent.h"
7#include "Events/MouseEvent.h"
8#include "Events/ApplicationEvent.h"
9#include "Window.h"
10#include "Platform/Vulkan/KarmaGuiVulkanHandler.h"
11#include "Platform/OpenGL/KarmaGuiOpenGLHandler.h"
12#include "Scene.h"
13
14namespace Karma
15{
16 class KARMA_API KarmaGuiLayer : public Layer
17 {
18 public:
19 KarmaGuiLayer(Window* relevantWindow);
21
22 virtual void OnAttach() override;
23 virtual void OnDetach() override;
24 virtual void ImGuiRender(float deltaTime) override;
25 virtual void OnUpdate(float deltaTime) override;
26
27 // Only for ImGui layer
28 void Begin();
29 void End();
30
31 virtual void OnEvent(Event& event) override;
32
33 // Vulkan relevant functions
34 void CreateDescriptorPool();
35 void GiveLoopBeginControlToVulkan();
36 void FrameRender(KarmaGui_ImplVulkanH_Window* windowData, KGDrawData* drawData);
37 void FramePresent(KarmaGui_ImplVulkanH_Window* windowData);
38 void GiveLoopEndControlToVulkan();
39 void GracefulVulkanShutDown();
40 void CleanUpVulkanAndWindowData();
41
42 private:
43 bool OnMouseButtonPressedEvent(MouseButtonPressedEvent& e);
44 bool OnMouseButtonReleasedEvent(MouseButtonReleasedEvent& e);
45 bool OnMouseMovedEvent(MouseMovedEvent& e);
46 bool OnMouseScrollEvent(MouseScrolledEvent& e);
47 bool OnKeyPressedEvent(KeyPressedEvent& e);
48 bool OnKeyReleasedEvent(KeyReleasedEvent& e);
49 bool OnKeyTypedEvent(KeyTypedEvent& e);
50 bool OnWindowResizeEvent(WindowResizeEvent& e);
51
52 private:
53 float m_Time = 0.0f;
54
55 Window* m_AssociatedWindow;
56
57 // Vulkan specific members
58 //VkDescriptorPool m_ImGuiDescriptorPool;
59
60 //bool m_SwapChainRebuild = true;
61
62 // Seems like main window Vulkan data associated to m_AssociatedWindow
63 //KarmaGui_ImplVulkanH_Window m_VulkanWindowData;
64 };
65}
Definition Event.h:35
Definition KarmaGuiLayer.h:17
Definition KeyEvent.h:25
Definition KeyEvent.h:45
Definition KeyEvent.h:61
Definition Layer.h:11
Definition MouseEvent.h:67
Definition MouseEvent.h:83
Definition MouseEvent.h:10
Definition MouseEvent.h:32
Definition ApplicationEvent.h:10
Definition Window.h:27
Definition KarmaGui.h:2647
Definition KarmaGuiVulkanHandler.h:83