ImGui.NET
ImGui.NET copied to clipboard
Expose imgui_internal.h
Hey,
it would be nice if this library could expose the contents of this aswell. It's compiled into the existing binary, so there is no need to change the compile flags or something. Since this part of the API is experimental/not so well tested i'd suggest using a seperate namespace for that functionality.
Unless the internal header gets parsed by cimgui, then I'd like to avoid adding this in. The reason for the new auto-generation approach is that it was far too difficult to keep the bindings up to date with breaking changes in the native code, and that problem would be exacerbated if I was trying to keep non-public stuff in sync.
I'd like to understand if there's a different bug that prevents the public splitter function from working first, at the very least.
Any update on this? There is quite a lot of functionality (for example disabling controls) which is only available through imgui.internal.h
.
Many projects that use ImGui and try to do custom widgets on top of ImGui heavily rely on the state exposed through imgui_internal.h
. It is possible to create custom widgets without it, but it's not really that clean.
Upvoting this!
@mellinoe There's some recent discussion about adding the internal header to cimgui over at cimgui/cimgui#108.
Its done already!!
@mellinoe is it possible to expose this now since cimgui exposes it ?
Wow, does this mean there is chance that we might get support of the internal API eventually? This would be awesome news because right now I'm hitting a wall with implementing specific features like dragging/click with middle mouse button. As I understood ocornut that is only possible by using the ButtonBehaviour API.
I have to voice my support for this. Trying to adapt any complex project with docking from C++ to C# is a disappointing experience, without DockBuilder. (Perhaps the core issue is docking being unfinished/experimental, but that's just the way things are.)
Is the cimgui handling of imgui_internal.h
acceptable enough now to start toying with this?
Looks like there is a way to turn it on in cimgui via the internal branch. Hopefully we can get a nuget package for this!
OK I've been looking a lot more into this, because I'm just spending hours of time trying to get layouts and custom things drawn with so many headaches, I constantly see solutions that are easy-to-go-to but require access to an internal member. Just to update anyone else finding this issue and my previous comment.
cimgui currently contains the internal header elements of ImGui. However, the code generator here in ImGui.NET explicitly ignores anything marked as internal. Why? I don't know.
I hacked on this earlier this year and got some of the stuff working: https://github.com/sneusse/ImGui.NET/tree/imgui_internal Sadly my version I used then is too outdated to merge now and had some project specific changes added but it might still be useful for somebody so I pushed it to GitHub.
It's really frustrating not being able to do what others have been doing for years already. In the meantime, if someone needs to achieve something similar there's the Table API, which kind of works (unless you want to dock/undock/move panes around).
I hacked on this earlier this year and got some of the stuff working: https://github.com/sneusse/ImGui.NET/tree/imgui_internal Sadly my version I used then is too outdated to merge now and had some project specific changes added but it might still be useful for somebody so I pushed it to GitHub.
What is the cnative dll?
[RendererFinder] System.DllNotFoundException: Unable to load DLL 'cnative' or one of its dependencies: The specified module could not be found. (0x8007007E)
at ImGuiNET.ImGuiNative.igGetIO()
at ImGuiNET.ImGui.GetIO()
at DearImGuiInjection.Backends.ImGuiWin32Impl.NewFrame()
at DearImGuiInjection.Backends.ImGuiDX11.NewFrame()
at DearImGuiInjection.Backends.ImGuiDX11.RenderImGui(SwapChain swapChain, UInt32 syncInterval, UInt32 flags)
at RendererFinder.Renderers.DX11Renderer.SwapChainPresentHook(IntPtr self, UInt32 syncInterval, UInt32 flags)
I hacked on this earlier this year and got some of the stuff working: https://github.com/sneusse/ImGui.NET/tree/imgui_internal Sadly my version I used then is too outdated to merge now and had some project specific changes added but it might still be useful for somebody so I pushed it to GitHub.
What is the cnative dll?
[RendererFinder] System.DllNotFoundException: Unable to load DLL 'cnative' or one of its dependencies: The specified module could not be found. (0x8007007E) at ImGuiNET.ImGuiNative.igGetIO() at ImGuiNET.ImGui.GetIO() at DearImGuiInjection.Backends.ImGuiWin32Impl.NewFrame() at DearImGuiInjection.Backends.ImGuiDX11.NewFrame() at DearImGuiInjection.Backends.ImGuiDX11.RenderImGui(SwapChain swapChain, UInt32 syncInterval, UInt32 flags) at RendererFinder.Renderers.DX11Renderer.SwapChainPresentHook(IntPtr self, UInt32 syncInterval, UInt32 flags)
I just renamed cimgui.dll to cnative.dll and it works. Not sure if there are other caveats. This is an awesome branch. Will really like to see this merged into main. @sneusse
Would love to see full docking support! It's a real bummer not being able to use DockBuilder
I'm not really sure, if this is related, but I'm looking for DockBuilderGetNode()
to set some dock node flags. Is this possible already, or is this also internal?
I'm not really sure, if this is related, but I'm looking for
DockBuilderGetNode()
to set some dock node flags. Is this possible already, or is this also internal?
If older version is okay for you, try the internal branch of this repo: https://github.com/sneusse/ImGui.NET Otherwise you can call the native wrapper directly using ImGuiNative
@krulci thank you for the fast reply! With tooll.io I'm currently stuck with 1.87 (because some smaller glitch in the updated input system), so your fork would be file. But currently I'm using the nuget-packet-system and I'm hesitant leaving that comfort zone.
I didn't know about ImGuiNative
. It looks super promising, but as far as I can see, it doesn't expose DockBuilderGetNode()
. Am I missing something here?
@krulci: I just renamed cimgui.dll to cnative.dll and it works. Not sure if there are other caveats. This is an awesome branch. Will really like to see this merged into main. @sneusse
Yeah sorry about that, for the project this is taken from I just wanted one library (combined cimgui, raylib, luajit) as that simplifies my build process :)
I also rebased on the new release (https://github.com/sneusse/ImGui.NET/tree/internal_rework), so 1.9 should work now (minor glitch: one enum will not be generated correctly) and you can now specify the generated DllImport name and some other stuff.
I didn't generate the code in the branch because I use wchar32 and some other custom ImGui settings that won't be for everyone. How to generate:
- Clone https://github.com/sneusse/ImGui.NET/tree/internal_rework (example: C:/repo)
- do a
dotnet run --project {imguiNetRepo}/src/CodeGenerator {outputPathOfGeneratedFiles} {libname} {cimportname} {wcharType} {originalcImguiJsons} internal
example:
dotnet run --project C:/repo/src/CodeGenerator C:/repo/src/ImGui.Net/Generated cimgui cimgui ushort C:/repo/src/CodeGenerator/definitions/cimgui internal
I'd do a PR but @Thraka s branch is basically doing the same thing and is open for a year now, so...