MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / RenderDimmedBackgroundBehindWindow

Method RenderDimmedBackgroundBehindWindow

external/imgui/imgui.cpp:5924–5949  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5922}
5923
5924static void ImGui::RenderDimmedBackgroundBehindWindow(ImGuiWindow* window, ImU32 col)
5925{
5926 if ((col & IM_COL32_A_MASK) == 0)
5927 return;
5928
5929 ImGuiViewportP* viewport = (ImGuiViewportP*)GetMainViewport();
5930 ImRect viewport_rect = viewport->GetMainRect();
5931
5932 // Draw behind window by moving the draw command at the FRONT of the draw list
5933 {
5934 // We've already called AddWindowToDrawData() which called DrawList->ChannelsMerge() on DockNodeHost windows,
5935 // and draw list have been trimmed already, hence the explicit recreation of a draw command if missing.
5936 // FIXME: This is creating complication, might be simpler if we could inject a drawlist in drawdata at a given position and not attempt to manipulate ImDrawCmd order.
5937 ImDrawList* draw_list = window->RootWindow->DrawList;
5938 if (draw_list->CmdBuffer.Size == 0)
5939 draw_list->AddDrawCmd();
5940 draw_list->PushClipRect(viewport_rect.Min - ImVec2(1, 1), viewport_rect.Max + ImVec2(1, 1), false); // FIXME: Need to strictly ensure ImDrawCmd are not merged (ElemCount==6 checks below will verify that)
5941 draw_list->AddRectFilled(viewport_rect.Min, viewport_rect.Max, col);
5942 ImDrawCmd cmd = draw_list->CmdBuffer.back();
5943 IM_ASSERT(cmd.ElemCount == 6);
5944 draw_list->CmdBuffer.pop_back();
5945 draw_list->CmdBuffer.push_front(cmd);
5946 draw_list->AddDrawCmd(); // We need to create a command as CmdBuffer.back().IdxOffset won't be correct if we append to same command.
5947 draw_list->PopClipRect();
5948 }
5949}
5950
5951ImGuiWindow* ImGui::FindBottomMostVisibleWindowWithinBeginStack(ImGuiWindow* parent_window)
5952{

Callers

nothing calls this directly

Calls 9

ImVec2Function · 0.85
GetMainRectMethod · 0.80
AddDrawCmdMethod · 0.80
AddRectFilledMethod · 0.80
backMethod · 0.80
PushClipRectMethod · 0.45
pop_backMethod · 0.45
push_frontMethod · 0.45
PopClipRectMethod · 0.45

Tested by

no test coverage detected