ImGui.NET icon indicating copy to clipboard operation
ImGui.NET copied to clipboard

Expose imgui_internal.h

Open feliwir opened this issue 6 years ago • 20 comments

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.

feliwir avatar Nov 18 '18 11:11 feliwir

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.

mellinoe avatar Nov 18 '18 18:11 mellinoe

Any update on this? There is quite a lot of functionality (for example disabling controls) which is only available through imgui.internal.h.

Folling avatar Jun 28 '19 21:06 Folling

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.

pragmascript avatar Oct 15 '19 11:10 pragmascript

Upvoting this!

enquel avatar Nov 05 '19 15:11 enquel

@mellinoe There's some recent discussion about adding the internal header to cimgui over at cimgui/cimgui#108.

opticfluorine avatar Nov 18 '19 01:11 opticfluorine

Its done already!!

sonoro1234 avatar Apr 08 '20 12:04 sonoro1234

@mellinoe is it possible to expose this now since cimgui exposes it ?

msmshazan avatar Jul 14 '20 06:07 msmshazan

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.

pixtur avatar Oct 03 '20 22:10 pixtur

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?

Marlax0 avatar Sep 13 '22 22:09 Marlax0

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!

Thraka avatar Nov 07 '22 20:11 Thraka

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.

Thraka avatar Nov 23 '22 19:11 Thraka

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.

sneusse avatar Jul 19 '23 15:07 sneusse

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).

trapazza avatar Jul 26 '23 00:07 trapazza

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)

krulci avatar Sep 25 '23 09:09 krulci

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

krulci avatar Sep 25 '23 10:09 krulci

Would love to see full docking support! It's a real bummer not being able to use DockBuilder

shayded-exe avatar Oct 26 '23 06:10 shayded-exe

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?

pixtur avatar Nov 03 '23 17:11 pixtur

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 avatar Nov 03 '23 17:11 krulci

@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?

pixtur avatar Nov 04 '23 12:11 pixtur

@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...

sneusse avatar Dec 08 '23 07:12 sneusse