- Clone
imgui
to own folder, specific tag. - Clone dear-bindings to own folder, NEXT TO imgui. Important!
- Install python/requirements for dear-bindings
- Run
BuildAllBindings.bat
- Edit examples/ImGuiLib
- Install vcpkg, ImGuiLib properties > vcpkg -> Use Vcpkg Manifest should be on Yes
- When compiling with Win32, Add a source file to the source folder. It should have:
- (Hack) remove extern in
dcimgui_impl_win32.h
such that it looks like this:
CIMGUI_IMPL_API LRESULT cImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
- Compile.
- Install ClangSharpPInvokeGenerator with
dotnet tool install --global ClangSharpPInvokeGenerator --version 20.1.2
- Run
generate_dotnet_bindings.bat
.
Note
You may also need to add #include <Windows.h>
above CIMGUI_IMPL_API LRESULT cImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
temporarily in dcimgui_impl_win32.h
And #include <d3d11.h>
to dcimgui_impl_dx11.h
so that the bindings generation works.
You may also need to adjust hardcoded paths I left in for plutosvg because I couldn't get Visual Studio/vcpkg to detect plutosvg as it should