2
3
4
5
10#include "Render/Vulkan/VulkanImage.h"
16 Begin(m_PanelName, alpha, flags);
19 void ImguiSlate::
Begin(
const std::string& panelName,
float alpha, ImGuiWindowFlags flags)
23 m_WindowFlags |= flags;
24 m_WindowFlags |= ImGuiWindowFlags_NoCollapse;
29 ImGui::SetNextWindowBgAlpha(alpha);
32 ImGui::Begin(panelName.c_str(), &m_IsSlateOn, m_WindowFlags);
34 if (ImGui::BeginPopupContextItem())
36 if (ImGui::MenuItem(
"Close"))
42
43
44 QueryIsResizedThisFrame(ImGui::GetContentRegionAvail());
47
48
52 m_PanelPos = ImGui::GetWindowPos();
53 m_IsFocused = ImGui::IsWindowFocused();
54 m_IsHovered = ImGui::IsWindowHovered();
69 auto rowPtr = ResourcePool<Texture>::Load<Texture2D>(iconFile, iconFile);
70 auto info = rowPtr->GetResource<VulkanImage>()->GetImageInfo();
72 id =
reinterpret_cast<ImTextureID>(ImGui_ImplVulkan_AddTexture(info->sampler, info->imageView, info->imageLayout));
79 if (m_PanelSize.x != thisFrameSize.x || m_PanelSize.y != thisFrameSize.y)
88 m_PanelSize = thisFrameSize;
#define SPICES_PROFILE_ZONEN(...)
#define SPICES_PROFILE_ZONE
void Begin(float alpha=1.0f, ImGuiWindowFlags flags=0)
Begin a common slate.
void Begin(const std::string &panelName, float alpha=1.0f, ImGuiWindowFlags flags=0)
Begin a common slate with name.
virtual void QueryIsResizedThisFrame(const ImVec2 &thisFrameSize)
Query whether viewport is resized this frame.
void LoadSlateIcon(ImTextureID &id, const std::string &iconFile)
Load a Texture from ResourcePool.
bool m_IsResized
Boolean of whether resized this frame.
This Class defines the basic behaves of specific slate. When we add an new Slate, we need inherit fro...