KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
KarmaGuiLayer.h
Go to the documentation of this file.
1
10
11#pragma once
12
13#include "krpch.h"
14
15#include "Layer.h"
16#include "Events/KeyEvent.h"
17#include "Events/MouseEvent.h"
19#include "Window.h"
22#include "Scene.h"
23
24namespace Karma
25{
26 class KARMA_API KarmaGuiLayer : public Layer
27 {
28 public:
29 KarmaGuiLayer(Window* relevantWindow);
30 ~KarmaGuiLayer();
31
32 virtual void OnAttach() override;
33 virtual void OnDetach() override;
34 virtual void KarmaGuiRender(float deltaTime) override;
35 virtual void OnUpdate(float deltaTime) override;
36
37 // Only for KarmaGui layer
38 void Begin();
39 void End();
40
41 virtual void OnEvent(Event& event) override;
42
43 // Vulkan relevant functions
44 void CreateDescriptorPool();
45 void GiveLoopBeginControlToVulkan();
46 void FrameRender(KarmaGui_ImplVulkanH_Window* windowData, KGDrawData* drawData);
47 void FramePresent(KarmaGui_ImplVulkanH_Window* windowData);
48 void GiveLoopEndControlToVulkan();
49 void GracefulVulkanShutDown();
50 void CleanUpVulkanAndWindowData();
51
52 private:
53 bool OnMouseButtonPressedEvent(MouseButtonPressedEvent& e);
54 bool OnMouseButtonReleasedEvent(MouseButtonReleasedEvent& e);
55 bool OnMouseMovedEvent(MouseMovedEvent& e);
56 bool OnMouseScrollEvent(MouseScrolledEvent& e);
57 bool OnKeyPressedEvent(KeyPressedEvent& e);
58 bool OnKeyReleasedEvent(KeyReleasedEvent& e);
59 bool OnKeyTypedEvent(KeyTypedEvent& e);
60 bool OnWindowResizeEvent(WindowResizeEvent& e);
61
62 private:
63 float m_Time = 0.0f;
64
65 Window* m_AssociatedWindow;
66
67 // Vulkan specific members
68 //VkDescriptorPool m_ImGuiDescriptorPool;
69
70 //bool m_SwapChainRebuild = true;
71
72 // Seems like main window Vulkan data associated to m_AssociatedWindow
73 //KarmaGui_ImplVulkanH_Window m_VulkanWindowData;
74 };
75}
This file contains the classes concerned with activity of Window.
#define KARMA_API
Defining Karma's API macro for storage class information.
Definition Core.h:41
This file contains KarmaGuiOpenGLHandler class and relevant data structures.
This file contains KarmaGuiVulkanHandler class and relevant data structures.
This file contains the classes concerned with activity of keyboard.
This file contains the Layer class.
This file contains the classes concerned with the movement and activity of mouse.
This file contains the class Scene.
This file contains the Window class.
The base class of all the events for Karma.
Definition Event.h:90
virtual void KarmaGuiRender(float deltaTime) override
Function called in each game loop, specifically for rendering purposes.
Definition KarmaGuiLayer.cpp:72
virtual void OnDetach() override
A function called on Layer when the LayerStack is destroyed.
Definition KarmaGuiLayer.cpp:59
virtual void OnUpdate(float deltaTime) override
Function called in each game loop.
Definition KarmaGuiLayer.cpp:89
virtual void OnEvent(Event &event) override
For dispatching Events specific to the Layer.
Definition KarmaGuiLayer.cpp:94
virtual void OnAttach() override
A function called on Layer when the Layer is pushed or OverLay is pushed.
Definition KarmaGuiLayer.cpp:29
Event triggered when the keyboard key is pressed.
Definition KeyEvent.h:53
Event triggered when the key is released.
Definition KeyEvent.h:97
Event triggered when keyboard key is used in typing.
Definition KeyEvent.h:130
Layer(const std::string &name="Layer")
A constructor.
Definition Layer.cpp:5
Event triggered when the mouse button is pressed.
Definition MouseEvent.h:136
Event triggered when the mouse button is released.
Definition MouseEvent.h:169
Event triggered on mouse movement (harkat)
Definition MouseEvent.h:21
Event triggered on scrolling of mouse.
Definition MouseEvent.h:69
The abstract base class of Karma's window (for platform specific purposes)
Definition Window.h:63
Event triggered when Window is resized.
Definition ApplicationEvent.h:22
Definition KarmaGui.h:2697
Helper structure to hold the data needed by one rendering context (Vulkan) of one OS window (Windows,...
Definition KarmaGuiVulkanHandler.h:281