A simple plugin for integrating Dear ImGui in Unreal Engine 5.
- The plugin is not production ready.
- The plugin is just something silly built to add QOL improvements to editor.
- The plugin is not compatible with UE4.
- Clone the repo in GameProject/Plugins folder along with submodule dependency
git clone --recurse-submodules [email protected]:amuTBKT/ImGuiPlugin.git
- ImGui and Implot binaries need to be compiled separately. The way unreal build setup works makes it difficult to include third party libraries, so they have to be compiled separately.
Source/Thirdparty/ImGui/Build.bat
, might require some modifications to patch cmake reference and setting compiler options (visual studio version etc)
Running the batch script should generate required libs under "/ImGuiPlugin/Source/Thirdparty/ImGui/Binaries" and "/ImGuiPlugin/Source/Thirdparty/ImGui/Intermediate" directories. - Include the plugin in your own modules.
At it's core the plugin is just a Slate widget with ImGui renderer, yes it's that simple :)
The plugin manages a global widget/window which can be used to add global widgets (managers, stats visualizer etc.)
User can also create SImGuiWidget
widget which works like any other Slate widget with an addition of Tick delegate which can be used to add ImGui widgets.
- Using
IMGUI_REGISTER_STATIC_WIDGET(InitFunction, TickFunction)
- Dynamically binding to main window delegate
UImGuiSubsystem* Subsystem = UImGuiSubsystem::Get(); MainWindowTickHandle = Subsystem->GetMainWindowTickDelegate().Add(TickDelegate);`
UImGuiSubsystem* Subsystem = UImGuiSubsystem::Get();
ImGuiWindow = Subsystem->CreateWindow("TestWindow", { 300., 300. }, TickDelegate);
Users can create SImGuiWidget
widget and add them to viewport or Slate containers, works similar to any other slate widget.