SpiecsEngine
 
Loading...
Searching...
No Matches

◆ OnRender()

void Spices::ImguiGPURuntimeProfilerHUD::OnRender ( )
overridevirtual

This interface is called On SlateRenderer Render.

Begin render PerfProfilerHUD.

Search String.

Begin render Search Input Text.

End render PerfProfilerHUD.

Begin render PerfProfilerHUD.

Search String.

Begin render Search Input Text.

End render PerfProfilerHUD.

Implements Spices::ImguiSlate.

Definition at line 20 of file ImguiGPURuntimeProfilerHUD.cpp.

21 {
23
24 NSIGHTPERF_GPUPROFILERHUD_SETINSESSION(m_IsSlateOn)
25
26 if (!m_IsSlateOn) return;
27
31 Begin();
32
33 ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(2.0f, 4.0f));
34
38 static std::string searchString;
39 static bool isEnableSearch = false;
40
44 {
45 SPICES_PROFILE_ZONEN("ImguiGPURuntimeProfilerHUD::Search");
46
47 ImGui::Spacing();
48 ImGui::PushItemWidth(m_PanelSize.x - ImGuiH::GetLineItemSize().x * 2.0f - ImGui::GetStyle().WindowPadding.x);
49 static char search[256] = {};
50 if (ImGui::InputTextWithHint("##", ICON_TEXT(ICON_MD_SEARCH, Search), search, 128))
51 {
52 searchString = std::string(search);
53 if (searchString.size() == 0) isEnableSearch = false;
54 else isEnableSearch = true;
55 }
56 ImGui::PopItemWidth();
57
58 ImGui::SameLine(m_PanelSize.x - ImGuiH::GetLineItemSize().x * 2.0f);
59 ImGui::Button(ICON_MD_FILTER_ALT, ImGuiH::GetLineItemSize());
60 ImGui::SameLine(m_PanelSize.x - ImGuiH::GetLineItemSize().x * 1.0f);
61 ImGui::Button(ICON_MD_REORDER, ImGuiH::GetLineItemSize());
62 ImGui::Spacing();
63 }
64
65 ImGui::PushStyleColor(ImGuiCol_Header, ImVec4(0.196f, 0.204f, 0.2f, 1.0f));
66 ImGui::PushStyleColor(ImGuiCol_HeaderHovered, ImVec4(0.164f, 0.18f, 0.184f, 1.0f));
67 ImGui::PushStyleColor(ImGuiCol_HeaderActive, ImVec4(0.164f, 0.18f, 0.184f, 1.0f));
68 ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.196f, 0.204f, 0.2f, 1.0f));
69
70 NSIGHTPERF_GPUPROFILERHUD_RENDERHUD
71
72 ImGui::PopStyleColor(4);
73 ImGui::PopStyleVar();
74
78 End();
79 }
#define ICON_TEXT(icon, text)
Definition ImguiHelper.h:24
#define SPICES_PROFILE_ZONEN(...)
#define SPICES_PROFILE_ZONE
static ImVec2 GetLineItemSize()
Get Line Width's Square Size.
void Begin(float alpha=1.0f, ImGuiWindowFlags flags=0)
Begin a common slate.
void End()
End a slate.
ImVec2 m_PanelSize
This slate's size.
Definition ImguiUtils.h:151

References Spices::ImguiSlate::End(), and Spices::ImguiSlate::m_IsSlateOn.