MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / IMGUI_CDECL ChildWindowComparer

Function IMGUI_CDECL ChildWindowComparer

imgui_tiny_app/imgui/imgui.cpp:5981–5990  ·  view source on GitHub ↗

FIXME: Add a more explicit sort order in the window structure.

Source from the content-addressed store, hash-verified

5979
5980// FIXME: Add a more explicit sort order in the window structure.
5981static int IMGUI_CDECL ChildWindowComparer(const void* lhs, const void* rhs)
5982{
5983 const ImGuiWindow* const a = *(const ImGuiWindow* const *)lhs;
5984 const ImGuiWindow* const b = *(const ImGuiWindow* const *)rhs;
5985 if (int d = (a->Flags & ImGuiWindowFlags_Popup) - (b->Flags & ImGuiWindowFlags_Popup))
5986 return d;
5987 if (int d = (a->Flags & ImGuiWindowFlags_Tooltip) - (b->Flags & ImGuiWindowFlags_Tooltip))
5988 return d;
5989 return a->BeginOrderWithinParent - b->BeginOrderWithinParent;
5990}
5991
5992static void AddWindowToSortBuffer(ImVector<ImGuiWindow*>* out_sorted_windows, ImGuiWindow* window)
5993{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected