Render: Removed the code that disable render if style.Alpha is 0.0f, it is both incorrect (as style Alpha can be modified mid-frame), not really necessary (just tested that full Alpha = 0 will lead to empty draw lists!) and misleading (bulk of the work was already done).

This commit is contained in:
omar 2018-03-05 22:47:53 +01:00
parent 945f4d1ecd
commit cea7492bab

View File

@ -4028,10 +4028,6 @@ void ImGui::Render()
ImGui::EndFrame(); ImGui::EndFrame();
g.FrameCountRendered = g.FrameCount; g.FrameCountRendered = g.FrameCount;
// Skip render altogether if alpha is 0.0
// Note that vertex buffers have been created and are wasted, so it is best practice that you don't create windows in the first place, or consistently respond to Begin() returning false.
if (g.Style.Alpha > 0.0f)
{
// Gather windows to render // Gather windows to render
g.IO.MetricsRenderVertices = g.IO.MetricsRenderIndices = g.IO.MetricsActiveWindows = 0; g.IO.MetricsRenderVertices = g.IO.MetricsRenderIndices = g.IO.MetricsActiveWindows = 0;
g.DrawDataBuilder.Clear(); g.DrawDataBuilder.Clear();
@ -4039,7 +4035,7 @@ void ImGui::Render()
for (int n = 0; n != g.Windows.Size; n++) for (int n = 0; n != g.Windows.Size; n++)
{ {
ImGuiWindow* window = g.Windows[n]; ImGuiWindow* window = g.Windows[n];
if (window->Active && window->HiddenFrames <= 0 && (window->Flags & (ImGuiWindowFlags_ChildWindow)) == 0 && window != window_to_render_front_most) if (window->Active && window->HiddenFrames <= 0 && (window->Flags & ImGuiWindowFlags_ChildWindow) == 0 && window != window_to_render_front_most)
AddWindowToDrawDataSelectLayer(window); AddWindowToDrawDataSelectLayer(window);
} }
if (window_to_render_front_most && window_to_render_front_most->Active && window_to_render_front_most->HiddenFrames <= 0) // NavWindowingTarget is always temporarily displayed as the front-most window if (window_to_render_front_most && window_to_render_front_most->Active && window_to_render_front_most->HiddenFrames <= 0) // NavWindowingTarget is always temporarily displayed as the front-most window
@ -4074,7 +4070,6 @@ void ImGui::Render()
g.IO.RenderDrawListsFn(&g.DrawData); g.IO.RenderDrawListsFn(&g.DrawData);
#endif #endif
} }
}
const char* ImGui::FindRenderedTextEnd(const char* text, const char* text_end) const char* ImGui::FindRenderedTextEnd(const char* text, const char* text_end)
{ {