-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose ImGui internals (experimental) using 1.85 WIP #273
base: master
Are you sure you want to change the base?
Conversation
Thanks for putting this together, experimental or not I will give it a shot. Not being able to predefine a docking layout makes it pretty annoying to use. |
I really want this and access to the internals!!! 😁 |
What else is needed for this pull request to be merged? more tests? features? I wanted to use this feature and maybe i can help out finishing this PR |
It's been a while since I worked on this, so bear with me if I miss something. The generated code seems be mostly correct, but still has a few obvious errors whose cause I can't find on my own. The PostFixes class kind of documents all these errors, and does some string replace/remove on the generated code to make the compiler happy. This approach works in theory, but has the obvious problem that we simply discard parts of the internals. It is also a pain to maintain, as we probably have to adjust these tweaks with every ImGui update. Therefore, we probably need to get rid of these monkey patches (basically remove the PostFixes file) as the next step. I'll try to find some time to rebase the PR in the next couple days. If it doesn't break too many things I'll also update to ImGui 1.87, maybe it fixes some of the issues 👍 |
@JulianVallee If you need any help tag me here, i can work with you if needed |
@JulianVallee I hope you dont mind but i stole a bit of your code and put on my own fork of imgui.net, i really want to test and use imgui, i gave you proper credits and i hope you dont mind. |
No not at all, feel free to use code of this PR in any way you want. Credits are highly appreciated, but wouldn't have been necessary! PS: Noticed the discord link in your readme.md doesn't work, the link is broken. |
It works fine on Windows, but on Linux, some APIs give the error EntryPoint not found, such as ImGui.PushStyleVar, ImGui.TreeNode, etc. How can I fix this problem? |
Maybe, it is time to move this discussion on that repo? It will help that repo grow and become as awesome as imgui.net. |
@zzxzzk115 If you want to talk about this please move to my repo https://github.com/MarioGK/ImGuiSharp |
That's great! Ok I'll keep watching on your repo. |
Does this expose the Impli methods that make implementing imgui for some api's easier? |
Works to a degree but using this on the latest version 1.89.3 causes so many errors it's pointless me even thinking about listing them all. What will it take to make this work with the latest ImGui version in order to update ImGui.NET to 1.89.3? |
I'm following this PR. Dockbuilder is something I'm very hyped about. |
Description
Add changes to expose ImGui internals using ImGui 1.85 WIP. This PR is based on the fork of https://github.com/renenieuw/ImGui.NET (see #202) and is currently in experimental status.
The fork introduces a last-moment string replacement on the generated files to allow correcting code that has not been generated properly. While it seems to be working at the moment, it kinda defeats the whole purpose of the code generator and focus should be on fixing the remaining errors to get rid of it again. Still having a pull request might get this feature a bit more attention than a fork mentioned deep down in a random issue.
I have added an example using the internal DockBuilder API in the SampleProgram.XNA project. However, it's probably better to move these changes into a separate PR and the regular/a more advanced example app.. "I got carried away while refactoring" does not even come close, there are a lot of changes that are really unnecessary for this feature. I'm open to all ideas though!
The C binaries have been compiled using ImGuiNET/ImGui.NET-nativebuild#3. The CodeGenerator can now be invoked with a third argument to enable or disable exposing internals in the generated files:
dotnet run -p src\CodeGenerator\CodeGenerator.csproj src\ImGui.NET\Generated cimgui true
Last but not least I have removed a non-existing reference from the ImPlot.NET project file, and the CodeGenerator can be forced to always copy the definition json files to the output folder by setting a environment variable:
SET CopyToOutputDirectory=Always
(any other value will fallback to the original behaviour of PreserveNewest)Without DockingEnable flag
With DockingEnable flag
Demo stuff is working too!
Type of change
How Has This Been Tested?
I have implemented an example of the internal DockBuilder API inside the XNA sample.
Test Configuration:
Checklist:
testsexamples that prove my fix is effective or that my feature works