mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
Added asserts to catch illegal modifications of the font atlas between NewFrame() and EndFrame()/Render(). (#1958)
This commit is contained in:
@ -3810,6 +3810,7 @@ void ImGui::NewFrame()
|
||||
g.WindowsActiveCount = 0;
|
||||
|
||||
// Setup current font and draw list
|
||||
g.IO.Fonts->Locked = true;
|
||||
SetCurrentFont(GetDefaultFont());
|
||||
IM_ASSERT(g.Font->IsLoaded());
|
||||
g.DrawListSharedData.ClipRectFullscreen = ImVec4(0.0f, 0.0f, g.IO.DisplaySize.x, g.IO.DisplaySize.y);
|
||||
@ -4451,6 +4452,9 @@ void ImGui::EndFrame()
|
||||
IM_ASSERT(g.Windows.Size == g.WindowsSortBuffer.Size); // we done something wrong
|
||||
g.Windows.swap(g.WindowsSortBuffer);
|
||||
|
||||
// Unlock font atlas
|
||||
g.IO.Fonts->Locked = false;
|
||||
|
||||
// Clear Input data for next frame
|
||||
g.IO.MouseWheel = g.IO.MouseWheelH = 0.0f;
|
||||
memset(g.IO.InputCharacters, 0, sizeof(g.IO.InputCharacters));
|
||||
|
Reference in New Issue
Block a user