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

Method addRect

Source/Falcor/Utils/UI/Gui.cpp:611–628  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

609}
610
611void GuiImpl::addRect(const float2& size, const float4& color, bool filled, bool sameLine)
612{
613 if (sameLine)
614 ImGui::SameLine();
615
616 const ImVec2& cursorPos = ImGui::GetCursorScreenPos();
617 ImVec2 bottomLeft{cursorPos.x + size.x, cursorPos.y + size.y};
618 ImVec4 rectColor{color.x, color.y, color.z, color.w};
619
620 if (filled)
621 {
622 ImGui::GetWindowDrawList()->AddRectFilled(ImGui::GetCursorScreenPos(), bottomLeft, ImGui::ColorConvertFloat4ToU32(rectColor));
623 }
624 else
625 {
626 ImGui::GetWindowDrawList()->AddRect(ImGui::GetCursorScreenPos(), bottomLeft, ImGui::ColorConvertFloat4ToU32(rectColor));
627 }
628}
629
630bool GuiImpl::addDropdown(const char label[], const Gui::DropdownList& values, uint32_t& var, bool sameLine)
631{

Callers 1

rectMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected