From 33ef3992f7972e7fc4476e15db6d04e7e168a1f8 Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 7 Apr 2015 13:36:11 +0100 Subject: [PATCH] Added IO.MetricsVertices counter --- imgui.cpp | 2 ++ imgui.h | 1 + 2 files changed, 3 insertions(+) diff --git a/imgui.cpp b/imgui.cpp index f709a25a..5a904c43 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -1670,6 +1670,7 @@ static inline void AddDrawListToRenderList(ImVector& out_render_lis if (draw_list->commands.back().vtx_count == 0) draw_list->commands.pop_back(); out_render_list.push_back(draw_list); + GImGui->IO.MetricsVertices += (int)draw_list->vtx_buffer.size(); } } @@ -2203,6 +2204,7 @@ void ImGui::Render() } // Gather windows to render + g.IO.MetricsVertices = 0; for (size_t i = 0; i < IM_ARRAYSIZE(g.RenderDrawLists); i++) g.RenderDrawLists[i].resize(0); for (size_t i = 0; i != g.Windows.size(); i++) diff --git a/imgui.h b/imgui.h index 02965f73..0d58ee5e 100644 --- a/imgui.h +++ b/imgui.h @@ -669,6 +669,7 @@ struct ImGuiIO bool WantCaptureMouse; // Mouse is hovering a window or widget is active (= ImGui will use your mouse input) bool WantCaptureKeyboard; // Widget is active (= ImGui will use your keyboard input) float Framerate; // Framerate estimation, in frame per second. Rolling average estimation based on IO.DeltaTime over 120 frames + int MetricsVertices; // Vertices processed during last call to Render() //------------------------------------------------------------------ // [Internal] ImGui will maintain those fields for you