From 571e7287d3e1d2dd08d462a30effbc457e7f233e Mon Sep 17 00:00:00 2001 From: Pascal Thomet Date: Sun, 26 May 2024 14:15:14 +0200 Subject: [PATCH] Add callback PostRenderDockableWindows --- src/hello_imgui/internal/backend_impls/abstract_runner.cpp | 3 +++ src/hello_imgui/runner_callbacks.h | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/hello_imgui/internal/backend_impls/abstract_runner.cpp b/src/hello_imgui/internal/backend_impls/abstract_runner.cpp index aa0c76c4..e034d48e 100644 --- a/src/hello_imgui/internal/backend_impls/abstract_runner.cpp +++ b/src/hello_imgui/internal/backend_impls/abstract_runner.cpp @@ -834,6 +834,9 @@ void AbstractRunner::RenderGui() Theme_WindowGui(params.imGuiWindowParams.tweakedTheme); + if (params.callbacks.PostRenderDockableWindows) + params.callbacks.PostRenderDockableWindows(); + DockingDetails::CloseWindowOrDock(params.imGuiWindowParams); } diff --git a/src/hello_imgui/runner_callbacks.h b/src/hello_imgui/runner_callbacks.h index 6738f633..ebe4fb75 100644 --- a/src/hello_imgui/runner_callbacks.h +++ b/src/hello_imgui/runner_callbacks.h @@ -131,6 +131,7 @@ struct RunnerCallbacks // --------------- GUI Callbacks ------------------- // `ShowGui`: Fill it with a function that will add your widgets. + // (ShowGui will be called at each frame, before rendering the Dockable windows, if any) VoidFunction ShowGui = EmptyVoidFunction(); // `ShowMenus`: Fill it with a function that will add ImGui menus by calling: @@ -250,6 +251,10 @@ struct RunnerCallbacks // on top of that content. VoidFunction CustomBackground = EmptyVoidFunction(); + // `PostRenderDockableWindows`: Fill it with a function that will be called + // after the dockable windows are rendered. + VoidFunction PostRenderDockableWindows = EmptyVoidFunction(); + // `AnyBackendEventCallback`: // Callbacks for events from a specific backend. _Only implemented for SDL. // where the event will be of type 'SDL_Event *'_