Open fkelava opened 1 month ago
Rough procedure for compiling an amended ImGui.NET/cimgui
:
git clone https://luajit.org/git/luajit.git
msvcbuild.bat
luajit.exe
, lua51.dll
to some arbitrary folder, and the contents of src/jit
to a folder lua/jit
in the same place as the former twogit clone --recursive https://github.com/cimgui/cimgui.git
generator/generator.bat
, edit the set PATH
directive to include your LuaJIT foldergenerator/generator.bat
, have the luajit
directive read ./generator.lua cl "internal noimstrv" dx11 win32 %*
generator/generator.bat
CMakeLists.txt
as such:
#general settings
file(GLOB IMGUI_SOURCES
cimgui.cpp
imgui/imgui.cpp
imgui/imgui_draw.cpp
imgui/imgui_demo.cpp
imgui/imgui_widgets.cpp
imgui/backends/imgui_impl_win32.cpp
imgui/backends/imgui_impl_dx11.cpp
${TABLES_SOURCE}
)
Manage Configurations
Toolset
to msvc_x86_x64
, save, then compilegit clone https://github.com/ImGuiNET/ImGui.NET
cimgui.dll
in deps/cimgui/win_x86
src\CodeGenerator\definitions\cimgui
, place cimgui
's generator/output/{impl_definitions,definitions,structs_and_enums}.json
CodeGenerator
's ImguiDefinitions.cs
according to: https://github.com/equilibrium-hub/ImGui.NET/commit/696c9b7a71a0e8adf19a0f108a1550e0075e41c3#diff-8a4f306bfae678663d6bfafdb3b902f8afe3246a28ccd14e1d3379d22476b152R42-R48, https://github.com/equilibrium-hub/ImGui.NET/commit/696c9b7a71a0e8adf19a0f108a1550e0075e41c3#diff-8a4f306bfae678663d6bfafdb3b902f8afe3246a28ccd14e1d3379d22476b152R108CodeGenerator
, run CodeGenerator
, place its output under ImGui.NET
's Generated
folderFahrenheit will bring LuaJIT, cimgui
and ImGui.NET
in as submodules and provide build scripts as soon as it is confirmed that this, in fact, works.
Partial: a4bfe84cd2b4db532f1532a5e46722a648462802, 2abe70869d83f42f59dc92cc9842163bc2751679
Enablement complete as of 1236a99545a845a1201859f4c5e9ae28fa500491.
Rendering hook still requires implementation, but beyond that we are- hopefully- done.
@fkelava did it :3
Commit of this functionality is still pending a better way to handle D3D/DXGI method invocation.
For a proof of concept I used Vortice.Windows, but this bundles an unacceptable amount of runtime dependencies. The relevant parts need to be "lifted" into Fahrenheit, but this is not trivial because we are dealing with COM interop.
At the very least we need:
IDXGISwapChain::GetBuffer
ID3D11Device::CreateRenderTargetView
ID3D11DeviceContext::OMSetRenderTargets
Release
the pointer obtained from GetBuffer.Implementation complete as of 650abb23560f016e7c0da2a0d4582a266af66571.
API bindings not yet set (i.e. that the ImGui core module invokes other modules' ImGui rendering callbacks), but the module can be used for internal testing even pending that.
At long last, we've done it.
(Closing this issue requires me to implement the actually allowing mods to render things using imgui part)
This did not initially work because of missing DX11/Win32 backend enablement.
ImGui.NET does not bundle/wrap the backends, so that is out of the question. We can therefore do two things:
imgui_impl_*.h
headers verbatim.