| 16593 | } |
| 16594 | |
| 16595 | void ImGui::ShowMetricsWindow(bool* p_open) |
| 16596 | { |
| 16597 | ImGuiContext& g = *GImGui; |
| 16598 | ImGuiIO& io = g.IO; |
| 16599 | ImGuiMetricsConfig* cfg = &g.DebugMetricsConfig; |
| 16600 | if (cfg->ShowDebugLog) |
| 16601 | ShowDebugLogWindow(&cfg->ShowDebugLog); |
| 16602 | if (cfg->ShowIDStackTool) |
| 16603 | ShowIDStackToolWindow(&cfg->ShowIDStackTool); |
| 16604 | |
| 16605 | if (!Begin("Dear ImGui Metrics/Debugger", p_open) || GetCurrentWindow()->BeginCount > 1) |
| 16606 | { |
| 16607 | End(); |
| 16608 | return; |
| 16609 | } |
| 16610 | |
| 16611 | // [DEBUG] Clear debug breaks hooks after exactly one cycle. |
| 16612 | DebugBreakClearData(); |
| 16613 | |
| 16614 | // Basic info |
| 16615 | Text("Dear ImGui %s (%d)", IMGUI_VERSION, IMGUI_VERSION_NUM); |
| 16616 | if (g.ContextName[0] != 0) |
| 16617 | { |
| 16618 | SameLine(); |
| 16619 | Text("(Context Name: \"%s\")", g.ContextName); |
| 16620 | } |
| 16621 | Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate); |
| 16622 | Text("%d vertices, %d indices (%d triangles)", io.MetricsRenderVertices, io.MetricsRenderIndices, io.MetricsRenderIndices / 3); |
| 16623 | Text("%d visible windows, %d current allocations", io.MetricsRenderWindows, g.DebugAllocInfo.TotalAllocCount - g.DebugAllocInfo.TotalFreeCount); |
| 16624 | //SameLine(); if (SmallButton("GC")) { g.GcCompactAll = true; } |
| 16625 | |
| 16626 | Separator(); |
| 16627 | |
| 16628 | // Debugging enums |
| 16629 | enum { WRT_OuterRect, WRT_OuterRectClipped, WRT_InnerRect, WRT_InnerClipRect, WRT_WorkRect, WRT_Content, WRT_ContentIdeal, WRT_ContentRegionRect, WRT_Count }; // Windows Rect Type |
| 16630 | const char* wrt_rects_names[WRT_Count] = { "OuterRect", "OuterRectClipped", "InnerRect", "InnerClipRect", "WorkRect", "Content", "ContentIdeal", "ContentRegionRect" }; |
| 16631 | enum { TRT_OuterRect, TRT_InnerRect, TRT_WorkRect, TRT_HostClipRect, TRT_InnerClipRect, TRT_BackgroundClipRect, TRT_ColumnsRect, TRT_ColumnsWorkRect, TRT_ColumnsClipRect, TRT_ColumnsContentHeadersUsed, TRT_ColumnsContentHeadersIdeal, TRT_ColumnsContentFrozen, TRT_ColumnsContentUnfrozen, TRT_Count }; // Tables Rect Type |
| 16632 | const char* trt_rects_names[TRT_Count] = { "OuterRect", "InnerRect", "WorkRect", "HostClipRect", "InnerClipRect", "BackgroundClipRect", "ColumnsRect", "ColumnsWorkRect", "ColumnsClipRect", "ColumnsContentHeadersUsed", "ColumnsContentHeadersIdeal", "ColumnsContentFrozen", "ColumnsContentUnfrozen" }; |
| 16633 | if (cfg->ShowWindowsRectsType < 0) |
| 16634 | cfg->ShowWindowsRectsType = WRT_WorkRect; |
| 16635 | if (cfg->ShowTablesRectsType < 0) |
| 16636 | cfg->ShowTablesRectsType = TRT_WorkRect; |
| 16637 | |
| 16638 | struct Funcs |
| 16639 | { |
| 16640 | static ImRect GetTableRect(ImGuiTable* table, int rect_type, int n) |
| 16641 | { |
| 16642 | ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent); // Always using last submitted instance |
| 16643 | if (rect_type == TRT_OuterRect) { return table->OuterRect; } |
| 16644 | else if (rect_type == TRT_InnerRect) { return table->InnerRect; } |
| 16645 | else if (rect_type == TRT_WorkRect) { return table->WorkRect; } |
| 16646 | else if (rect_type == TRT_HostClipRect) { return table->HostClipRect; } |
| 16647 | else if (rect_type == TRT_InnerClipRect) { return table->InnerClipRect; } |
| 16648 | else if (rect_type == TRT_BackgroundClipRect) { return table->BgClipRect; } |
| 16649 | else if (rect_type == TRT_ColumnsRect) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->MinX, table->InnerClipRect.Min.y, c->MaxX, table->InnerClipRect.Min.y + table_instance->LastOuterHeight); } |
| 16650 | else if (rect_type == TRT_ColumnsWorkRect) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->WorkRect.Min.y, c->WorkMaxX, table->WorkRect.Max.y); } |
| 16651 | else if (rect_type == TRT_ColumnsClipRect) { ImGuiTableColumn* c = &table->Columns[n]; return c->ClipRect; } |
| 16652 | else if (rect_type == TRT_ColumnsContentHeadersUsed){ ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y, c->ContentMaxXHeadersUsed, table->InnerClipRect.Min.y + table_instance->LastTopHeadersRowHeight); } // Note: y1/y2 not always accurate |
nothing calls this directly
no test coverage detected