[simgui] Add GUI context getter hooks (#8127)

This enables GUI libraries to be linked statically with shared context.
This commit is contained in:
Peter Johnson
2025-07-30 21:29:24 -07:00
committed by GitHub
parent e678a338b4
commit 0478176e47
4 changed files with 52 additions and 0 deletions

View File

@@ -6,6 +6,16 @@
#include <functional>
struct ImGuiContext;
namespace glass {
class Context;
} // namespace glass
namespace wpi::gui {
struct Context;
} // namespace wpi::gui
namespace halsimgui {
// These functions can be used to hook into the GUI, and can be accessed
@@ -23,4 +33,13 @@ using AddGuiEarlyExecuteFn = void (*)(std::function<void()> execute);
#define HALSIMGUI_EXT_GUIEXIT "halsimgui::GuiExit"
using GuiExitFn = void (*)();
#define HALSIMGUI_EXT_GETIMGUICONTEXT "halsimgui::GetImguiContext"
using GetImguiContextFn = ImGuiContext* (*)();
#define HALSIMGUI_EXT_GETGUICONTEXT "halsimgui::GetGuiContext"
using GetGuiContextFn = wpi::gui::Context* (*)();
#define HALSIMGUI_EXT_GETGLASSCONTEXT "halsimgui::GetGlassContext"
using GetGlassContextFn = glass::Context* (*)();
} // namespace halsimgui