SpiecsEngine
 
Loading...
Searching...
No Matches
ImguiGBufferVisualizer.h
Go to the documentation of this file.
1/**
2* @file ImguiVisualizer.h
3* @brief The ImguiVisualizer Class Definitions.
4* @author Spices.
5*/
6
7#pragma once
8#include "Core/Core.h"
9#include "Slate/Imgui/ImguiUtils.h"
10
11namespace Spices {
12
13 /**
14 * @brief The GBuffer Texture's ImTextureID.
15 */
16 struct GBufferID
17 {
18 ImTextureID SceneColorID; // ImTextureID of SceneColor.
19 ImTextureID AlbedoID; // ImTextureID of Albedo.
20 ImTextureID NormalID; // ImTextureID of Normal.
21 ImTextureID RoughnessID; // ImTextureID of Roughness.
22 ImTextureID MetallicID; // ImTextureID of Metallic.
23 ImTextureID PositionID; // ImTextureID of Position.
24
25 ImTextureID IDID; // ImTextureID of ID Resource , pure red, so not show.
26 ImTextureID DepthID; // ImTextureID of Depth Resource, pure red, so not show.
27
28 /**
29 * @brief Free in used DescriptorSet used by GBuffer Visualizer.
30 */
31 void Free() const
32 {
33 ImGui_ImplVulkan_RemoveTexture(reinterpret_cast<VkDescriptorSet>(SceneColorID));
34 ImGui_ImplVulkan_RemoveTexture(reinterpret_cast<VkDescriptorSet>(AlbedoID));
35 ImGui_ImplVulkan_RemoveTexture(reinterpret_cast<VkDescriptorSet>(NormalID));
36 ImGui_ImplVulkan_RemoveTexture(reinterpret_cast<VkDescriptorSet>(RoughnessID));
37 ImGui_ImplVulkan_RemoveTexture(reinterpret_cast<VkDescriptorSet>(MetallicID));
38 ImGui_ImplVulkan_RemoveTexture(reinterpret_cast<VkDescriptorSet>(PositionID));
39 }
40 };
41
42 /*
43 * @brief The ImguiGBufferVisualizer Class.
44 * This class defines how to render a GBuffer Visualizer.
45 */
47 {
48 public:
49
50 /**
51 * @brief Constructor Function.
52 * @param[in] panelName The Slate's name to show.
53 * @param[in] frameInfo The Frame Date that in use.
54 */
56 const std::string& panelName ,
57 FrameInfo& frameInfo
58 );
59
60 /**
61 * @brief Destructor Function.
62 */
63 virtual ~ImguiGBufferVisualizer() override = default;
64
65 /**
66 * @brief This interface is called On SlateSystem Update.
67 * @param[in] ts TimeStep.
68 */
69 virtual void OnUpdate(TimeStep& ts) override {}
70
71 /**
72 * @brief This interface is called On SlateRenderer Render.
73 */
74 virtual void OnRender() override;
75
76 /**
77 * @brief This interface is called On Global Event Function Pointer is called.
78 */
79 virtual void OnEvent(Event& event) override;
80
81 private:
82
83 /**
84 * @brief Event Dispatcher target. Registy on Slate(Viewport) Resized.
85 * @param[in] event SlateResizeEvent.
86 * @return Returns true if need block the event.
87 */
89
90 /**
91 * @brief Query GBufferID from RendererResourcePool.
92 */
93 void QueryGBufferID();
94
95 private:
96
97 /**
98 * @brief The instance of GBufferID.
99 */
101
102 /**
103 * @brief The slate width.
104 */
105 float m_Width = 500;
106
107 /**
108 * @brief The slate height.
109 */
110 float m_Height = 500;
111 };
112}
#define BIND_EVENT_FN(x)
Bind Event.
Definition Event.h:88
#define SPICES_PROFILE_ZONEN(...)
#define SPICES_PROFILE_ZONE
EventDispatcher(Event &event)
Constructor Function.
Definition Event.h:172
This Class store a Specific Event type first and Dispatch a event handle function to it.
Definition Event.h:156
This Class is the basic Event Class. Inherit from it and create specific event class.
Definition Event.h:96
FrameInfo Class. This class defines the FrameInfo data.
Definition FrameInfo.h:32
virtual void OnUpdate(TimeStep &ts) override
This interface is called On SlateSystem Update.
GBufferID m_GBufferID
The instance of GBufferID.
virtual ~ImguiGBufferVisualizer() override=default
Destructor Function.
void QueryGBufferID()
Query GBufferID from RendererResourcePool.
bool OnSlateResized(SlateResizeEvent &event)
Event Dispatcher target. Registy on Slate(Viewport) Resized.
virtual void OnEvent(Event &event) override
This interface is called On Global Event Function Pointer is called.
ImguiGBufferVisualizer(const std::string &panelName, FrameInfo &frameInfo)
Constructor Function.
virtual void OnRender() override
This interface is called On SlateRenderer Render.
void End()
End a slate.
ImguiSlate(const std::string &panelName, FrameInfo &frameInfo)
Constructor Function. Init with Slate's name.
Definition ImguiUtils.h:35
This Class defines the basic behaves of specific slate. When we add an new Slate, we need inherit fro...
Definition ImguiUtils.h:27
const uint32_t & GetHeight() const
Get New Viewport Height.
Definition SlateEvent.h:46
const uint32_t & GetWidth() const
Get New Viewport Width.
Definition SlateEvent.h:40
This Class is inherited from Event Class. Called by Viewport Resize.
Definition SlateEvent.h:18
This Class handles our engine time step during frames. Global Unique.
Definition TimeStep.h:22
void Free() const
Free in used DescriptorSet used by GBuffer Visualizer.
The GBuffer Texture's ImTextureID.