|
@@ -3553,7 +3553,7 @@ void ImGui::EndFrame()
|
|
IM_ASSERT(g.Initialized);
|
|
IM_ASSERT(g.Initialized);
|
|
if (g.FrameCountEnded == g.FrameCount) // Don't process EndFrame() multiple times.
|
|
if (g.FrameCountEnded == g.FrameCount) // Don't process EndFrame() multiple times.
|
|
return;
|
|
return;
|
|
- IM_ASSERT(g.FrameScopeActive && "Forgot to call ImGui::NewFrame()");
|
|
|
|
|
|
+ IM_ASSERT(g.FrameScopeActive && "Forgot to call ImGui::NewFrame()?");
|
|
|
|
|
|
// Notify OS when our Input Method Editor cursor has moved (e.g. CJK inputs using Microsoft IME)
|
|
// Notify OS when our Input Method Editor cursor has moved (e.g. CJK inputs using Microsoft IME)
|
|
if (g.IO.ImeSetInputScreenPosFn && ImLengthSqr(g.PlatformImeLastPos - g.PlatformImePos) > 0.0001f)
|
|
if (g.IO.ImeSetInputScreenPosFn && ImLengthSqr(g.PlatformImeLastPos - g.PlatformImePos) > 0.0001f)
|
|
@@ -3562,8 +3562,17 @@ void ImGui::EndFrame()
|
|
g.PlatformImeLastPos = g.PlatformImePos;
|
|
g.PlatformImeLastPos = g.PlatformImePos;
|
|
}
|
|
}
|
|
|
|
|
|
- // Hide implicit "Debug" window if it hasn't been used
|
|
|
|
- IM_ASSERT(g.CurrentWindowStack.Size == 1); // Mismatched Begin()/End() calls, did you forget to call end on g.CurrentWindow->Name?
|
|
|
|
|
|
+ // Report when there is a mismatch of Begin/BeginChild vs End/EndChild calls. Important: Remember that the Begin/BeginChild API requires you
|
|
|
|
+ // to always call End/EndChild even if Begin/BeginChild returns false! (this is unfortunately inconsistent with most other Begin* API).
|
|
|
|
+ if (g.CurrentWindowStack.Size != 1)
|
|
|
|
+ {
|
|
|
|
+ if (g.CurrentWindowStack.Size > 1)
|
|
|
|
+ IM_ASSERT(g.CurrentWindowStack.Size == 1 && "Mismatched Begin/BeginChild vs End/EndChild calls: did you forget to call End/EndChild?");
|
|
|
|
+ else
|
|
|
|
+ IM_ASSERT(g.CurrentWindowStack.Size == 1 && "Mismatched Begin/BeginChild vs End/EndChild calls: did you call End/EndChild too much?");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // Hide implicit/fallback "Debug" window if it hasn't been used
|
|
if (g.CurrentWindow && !g.CurrentWindow->WriteAccessed)
|
|
if (g.CurrentWindow && !g.CurrentWindow->WriteAccessed)
|
|
g.CurrentWindow->Active = false;
|
|
g.CurrentWindow->Active = false;
|
|
End();
|
|
End();
|
|
@@ -3699,7 +3708,7 @@ void ImGui::Render()
|
|
g.IO.MetricsRenderVertices = g.DrawData.TotalVtxCount;
|
|
g.IO.MetricsRenderVertices = g.DrawData.TotalVtxCount;
|
|
g.IO.MetricsRenderIndices = g.DrawData.TotalIdxCount;
|
|
g.IO.MetricsRenderIndices = g.DrawData.TotalIdxCount;
|
|
|
|
|
|
- // Render. If user hasn't set a callback then they may retrieve the draw data via GetDrawData()
|
|
|
|
|
|
+ // (Legacy) Call the Render callback function. The current prefer way is to let the user retrieve GetDrawData() and call the render function themselves.
|
|
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
if (g.DrawData.CmdListsCount > 0 && g.IO.RenderDrawListsFn != NULL)
|
|
if (g.DrawData.CmdListsCount > 0 && g.IO.RenderDrawListsFn != NULL)
|
|
g.IO.RenderDrawListsFn(&g.DrawData);
|
|
g.IO.RenderDrawListsFn(&g.DrawData);
|