MCPcopy Create free account
hub / github.com/Raais/ImStudio / UpdateDebugToolStackQueries

Method UpdateDebugToolStackQueries

src/third-party/imgui/imgui.cpp:12939–12976  ·  view source on GitHub ↗

[DEBUG] Stack Tool: update queries. Called by NewFrame()

Source from the content-addressed store, hash-verified

12937
12938// [DEBUG] Stack Tool: update queries. Called by NewFrame()
12939void ImGui::UpdateDebugToolStackQueries()
12940{
12941 ImGuiContext& g = *GImGui;
12942 ImGuiStackTool* tool = &g.DebugStackTool;
12943
12944 // Clear hook when stack tool is not visible
12945 g.DebugHookIdInfo = 0;
12946 if (g.FrameCount != tool->LastActiveFrame + 1)
12947 return;
12948
12949 // Update queries. The steps are: -1: query Stack, >= 0: query each stack item
12950 // We can only perform 1 ID Info query every frame. This is designed so the GetID() tests are cheap and constant-time
12951 const ImGuiID query_id = g.HoveredIdPreviousFrame ? g.HoveredIdPreviousFrame : g.ActiveId;
12952 if (tool->QueryId != query_id)
12953 {
12954 tool->QueryId = query_id;
12955 tool->StackLevel = -1;
12956 tool->Results.resize(0);
12957 }
12958 if (query_id == 0)
12959 return;
12960
12961 // Advance to next stack level when we got our result, or after 2 frames (in case we never get a result)
12962 int stack_level = tool->StackLevel;
12963 if (stack_level >= 0 && stack_level < tool->Results.Size)
12964 if (tool->Results[stack_level].QuerySuccess || tool->Results[stack_level].QueryFrameCount > 2)
12965 tool->StackLevel++;
12966
12967 // Update hook
12968 stack_level = tool->StackLevel;
12969 if (stack_level == -1)
12970 g.DebugHookIdInfo = query_id;
12971 if (stack_level >= 0 && stack_level < tool->Results.Size)
12972 {
12973 g.DebugHookIdInfo = tool->Results[stack_level].ID;
12974 tool->Results[stack_level].QueryFrameCount++;
12975 }
12976}
12977
12978// [DEBUG] Stack tool: hooks called by GetID() family functions
12979void ImGui::DebugHookIdInfo(ImGuiID id, ImGuiDataType data_type, const void* data_id, const void* data_id_end)

Callers

nothing calls this directly

Calls 1

resizeMethod · 0.80

Tested by

no test coverage detected