From f304603e13f8548f2126cbca3392636b9663c5ce Mon Sep 17 00:00:00 2001 From: Gereon V <72784429+GereonV@users.noreply.github.com> Date: Sun, 16 Apr 2023 00:45:21 +0200 Subject: [PATCH] Backends: GLUT: remove call to ImGui::NewFrame() from ImGui_ImplGLUT_NewFrame(). (#6337) --- backends/imgui_impl_glut.cpp | 4 +--- docs/CHANGELOG.txt | 4 ++++ examples/example_glut_opengl2/main.cpp | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/backends/imgui_impl_glut.cpp b/backends/imgui_impl_glut.cpp index 4734e4927..5a3e7cc1d 100644 --- a/backends/imgui_impl_glut.cpp +++ b/backends/imgui_impl_glut.cpp @@ -21,6 +21,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2023-04-17: BREAKING: Removed call to ImGui::NewFrame() from ImGui_ImplGLUT_NewFrame(). Needs to be called from the main application loop, like with every other backends. // 2022-09-26: Inputs: Renamed ImGuiKey_ModXXX introduced in 1.87 to ImGuiMod_XXX (old names still supported). // 2022-01-26: Inputs: replaced short-lived io.AddKeyModsEvent() (added two weeks ago) with io.AddKeyEvent() using ImGuiKey_ModXXX flags. Sorry for the confusion. // 2022-01-17: Inputs: calling new io.AddMousePosEvent(), io.AddMouseButtonEvent(), io.AddMouseWheelEvent() API (1.87+). @@ -202,9 +203,6 @@ void ImGui_ImplGLUT_NewFrame() delta_time_ms = 1; io.DeltaTime = delta_time_ms / 1000.0f; g_Time = current_time; - - // Start the frame - ImGui::NewFrame(); } static void ImGui_ImplGLUT_UpdateKeyModifiers() diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 5ad221bdb..72771734c 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -37,9 +37,13 @@ HOW TO UPDATE? Breaking changes: +- Backends: GLUT: Removed call to ImGui::NewFrame() from ImGui_ImplGLUT_NewFrame(). + It needs to be called from the main app loop, like with every other backends. (#6337) [@GereonV] + Other changes: + ----------------------------------------------------------------------- VERSION 1.89.5 (Released 2023-04-13) ----------------------------------------------------------------------- diff --git a/examples/example_glut_opengl2/main.cpp b/examples/example_glut_opengl2/main.cpp index 9333d13a3..b7a07e8bf 100644 --- a/examples/example_glut_opengl2/main.cpp +++ b/examples/example_glut_opengl2/main.cpp @@ -107,6 +107,7 @@ void MainLoopStep() // Start the Dear ImGui frame ImGui_ImplOpenGL2_NewFrame(); ImGui_ImplGLUT_NewFrame(); + ImGui::NewFrame(); // 1. Show the big demo window (Most of the sample code is in ImGui::ShowDemoWindow()! You can browse its code to learn more about Dear ImGui!). if (show_demo_window)