MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / drawBar

Function drawBar

Source/Falcor/Utils/Timing/ProfilerUI.cpp:82–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80};
81
82void drawBar(float fraction, const ImVec2& size, ImU32 color = 0xffffffff, ImU32 background = 0x00000000, bool highlight = false)
83{
84 auto cursorPos = ImGui::GetCursorScreenPos();
85 auto height = ImGui::GetTextLineHeightWithSpacing();
86 cursorPos.y += 0.5f * (height - size.y);
87 ImGui::GetWindowDrawList()->AddRectFilled(
88 ImVec2(cursorPos.x, cursorPos.y), ImVec2(cursorPos.x + size.x, cursorPos.y + size.y), background
89 );
90 ImGui::GetWindowDrawList()->AddRectFilled(
91 ImVec2(cursorPos.x, cursorPos.y), ImVec2(cursorPos.x + fraction * size.x, cursorPos.y + size.y), color
92 );
93 if (highlight)
94 ImGui::GetWindowDrawList()->AddRect(
95 ImVec2(cursorPos.x, cursorPos.y), ImVec2(cursorPos.x + size.x, cursorPos.y + size.y), kHighlightColor
96 );
97}
98} // namespace
99
100void ProfilerUI::render()

Callers 1

renderMethod · 0.85

Calls 1

ImVec2Class · 0.85

Tested by

no test coverage detected