mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-23 04:17:00 +00:00
Added io.MetricsActiveWindows counter (#213)
This commit is contained in:
parent
5df542c3c0
commit
1e4c22c206
@ -2255,6 +2255,7 @@ void ImGui::Render()
|
|||||||
|
|
||||||
// Gather windows to render
|
// Gather windows to render
|
||||||
g.IO.MetricsRenderVertices = 0;
|
g.IO.MetricsRenderVertices = 0;
|
||||||
|
g.IO.MetricsActiveWindows = 0;
|
||||||
for (size_t i = 0; i < IM_ARRAYSIZE(g.RenderDrawLists); i++)
|
for (size_t i = 0; i < IM_ARRAYSIZE(g.RenderDrawLists); i++)
|
||||||
g.RenderDrawLists[i].resize(0);
|
g.RenderDrawLists[i].resize(0);
|
||||||
for (size_t i = 0; i != g.Windows.size(); i++)
|
for (size_t i = 0; i != g.Windows.size(); i++)
|
||||||
@ -2263,6 +2264,7 @@ void ImGui::Render()
|
|||||||
if (window->Active && window->HiddenFrames <= 0 && (window->Flags & (ImGuiWindowFlags_ChildWindow)) == 0)
|
if (window->Active && window->HiddenFrames <= 0 && (window->Flags & (ImGuiWindowFlags_ChildWindow)) == 0)
|
||||||
{
|
{
|
||||||
// FIXME: Generalize this with a proper layering system so we can stack.
|
// FIXME: Generalize this with a proper layering system so we can stack.
|
||||||
|
g.IO.MetricsActiveWindows++;
|
||||||
if (window->Flags & ImGuiWindowFlags_Popup)
|
if (window->Flags & ImGuiWindowFlags_Popup)
|
||||||
AddWindowToRenderList(g.RenderDrawLists[1], window);
|
AddWindowToRenderList(g.RenderDrawLists[1], window);
|
||||||
else if (window->Flags & ImGuiWindowFlags_Tooltip)
|
else if (window->Flags & ImGuiWindowFlags_Tooltip)
|
||||||
|
1
imgui.h
1
imgui.h
@ -700,6 +700,7 @@ struct ImGuiIO
|
|||||||
bool WantCaptureKeyboard; // Widget is active (= ImGui will use your keyboard 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
|
float Framerate; // Framerate estimation, in frame per second. Rolling average estimation based on IO.DeltaTime over 120 frames
|
||||||
int MetricsRenderVertices; // Vertices processed during last call to Render()
|
int MetricsRenderVertices; // Vertices processed during last call to Render()
|
||||||
|
int MetricsActiveWindows; // Number of visible windows (exclude child windows)
|
||||||
|
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
// [Internal] ImGui will maintain those fields for you
|
// [Internal] ImGui will maintain those fields for you
|
||||||
|
Loading…
Reference in New Issue
Block a user