From b771cdd2e5a70311c0790382c6e23dbedd03956f Mon Sep 17 00:00:00 2001 From: Pascal Thomet Date: Tue, 19 Dec 2023 21:33:27 +0100 Subject: [PATCH] params.callback.PreNewFrame before all NewFrame (Backends and ImGui) --- src/hello_imgui/internal/backend_impls/abstract_runner.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hello_imgui/internal/backend_impls/abstract_runner.cpp b/src/hello_imgui/internal/backend_impls/abstract_runner.cpp index a47d17f0..af998421 100644 --- a/src/hello_imgui/internal/backend_impls/abstract_runner.cpp +++ b/src/hello_imgui/internal/backend_impls/abstract_runner.cpp @@ -608,6 +608,9 @@ void AbstractRunner::CreateFramesAndRender() // // Rendering logic // + if (params.callbacks.PreNewFrame) + params.callbacks.PreNewFrame(); + mRenderingBackendCallbacks.Impl_NewFrame_3D(); Impl_NewFrame_Backend(); { @@ -621,9 +624,6 @@ void AbstractRunner::CreateFramesAndRender() io.DeltaTime = 1.f / 60.f; } - if (params.callbacks.PreNewFrame) - params.callbacks.PreNewFrame(); - ImGui::NewFrame(); // Fight against potential font loading issue