-
Notifications
You must be signed in to change notification settings - Fork 310
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
Add ImGuizmo and ImGuiPlot to Nuget #247
Comments
For now, you can simply:
using ImGuiNET;
using ImPlotNET;
using System.Runtime.InteropServices;
// More code
IntPtr context = ImGui.CreateContext();
IntPtr implotContext = ImPlot.CreateContext();
ImPlot.SetCurrentContext(implotContext);
ImPlot.SetImGuiContext(context);
// Other code
if (ImPlot.BeginPlot("Some Plot"))
{
Span<double> xVals = new Span<double>(new double[]{0.0, 1.0, 2.0});
Span<double> yVals = new Span<double>(new double[]{1.0, 0.0, 1.0});
ImPlot.PlotLine("Test", ref MemoryMarshal.GetReference(xVals), ref MemoryMarshal.GetReference(yVals), xVals.Length);
ImPlot.EndPlot();
}
// More code
ImPlot.DestroyContext();
ImGui.DestroyContext(); NOTE: If you are getting access violations, be sure to use all 4 DLL's that were generated by the nativebuild. Otherwise you will have mismatching ImGui versions. |
Oh thank wil this all work with Other render apis like OpenTK? |
Oh and also i cant seem to get the build correctly for some reason |
I sadly don't know.
Did you init/update all submodules first? What type of error/problem are you running into? This is what I did to build it:
works fine on my machine™. |
It only compiles for the imgui folder the implot, imguizmo and imnodes dont compile apparently |
You'll need to provide more information. What you did, Compiler Output, etc. |
When i git clone the repository it only comes with the cimgui folder and in the .gitmodules it does not include the other stuff just the cimgui and i also tried downloading the zip it comes with everything but when i try to compile it with cmake it says that there is an error with the cmakeList.txt |
@Pastor111 Your guide should be the first post from @Kayzaks where is telling you to clone https://github.com/TillAlex/ImGui.NET-nativebuild/tree/additional_libraries. You should clone this one and not any other (as it seems to be happening). If you download the zip the submodules will be missing. You should do the clone with where Then you should do Then you will have to build with cmake. If something fails dont forget to provide the informations of all the commands used in the process and the output messages. Also: this message #218 (comment) is telling you where to find compiled binaries. |
I think i got it correct now but when i try to link it cimguizmo and the other libraries it says that the reference is unvalid or unsopported |
Cool. Please re-read and re-follow the steps in our previous comments, it should be working. If not I would like to emphasize the following comments:
and
and
|
guide here : https://github.com/shlifedev/.net-imgui-native-build-guide cimgui 1.82 dlls : https://github.com/shlifedev/.net-imgui-native-build-guide/releases/tag/1.82 ❤️ |
Thanks, i will see if it works in a moment |
I have a question when i add the 4 dlls in my project should i unistall the Imgui.NET package or should i keep it? |
if you want use
and add your .exe build folder |
Is there any update on making these available through NuGet? I'm aware of the manual compilation option but NuGet is much more convenient |
按照上面[sonoro1234] (https://github.com/sonoro1234)[native](https://github.com/TillAlex/ImGui.NET-nativebuild/tree/additional_libraries) 编译后,调用cimplot.dll,并按照时[Kayzaks]方法使用时,总是报“Attempted to read or write protected memory. ”错误。然后他这个版本匹配很重要,ImGui.Net使用的版本和cimgui的版本要对应上,像TillAlax里是cimgui 1.82+ cimplot 0.9,他提供的deps里或者编译完成的dll版本,自然而然是基于1.82的,而我当时使用的ImGui.Net是1.87版本,我直接拷贝了TiilAlax的编译dll就发生了这个错误,而我后来的解决方法就是,直接在Tillax的0.9 cimplot基础上,拷贝1.87的cimgui覆盖并重新编译,就能正常使用cimplot.dll了。 其实最好的方法是重写各个版本对应的CodeGenerator里的definitions和cimgui.cpp\h包装,一一对应。但是他们这个json当时写的时候不会都是全手写,一个个对函数的吧?没有直接更新的工具吗? |
In order to get the ImPlot binaries for using ImPlot.NET, I've been trying to follow your instructions but without success thus far... Cloning the repository works:
Switching to the branch works:
Building the stuff does not work, unfortunately:
By looking at the folder, So, next, I've followed the instructions in repository README to initialize submodules:
These do work but Following your next step suggesting to look at #218 (comment), I'm greeted with the following:
So yeah, the binaries are long gone since it's been a while they've been published... Any ideas to get hold of ImPlot binaries are more than welcome. Thanks for your time! |
When looking at https://github.com/TillAlex/ImGui.NET-nativebuild on the branch additional_libraries with the web interface of github, it is possible to see that imbui_tables.cpp is present, so that should not happen. You could try using But if you succed, you will be on tag 1.82 of imgui (2 years ago). It has not been updated since then. |
Yes, TillAlex fork is really outdated by now... Unless I'm mistaken, yesterday's commit indeed does include changes to the managed side of implot but unfortunately still no cimplot.dll. I've just forked cimplot in order to build it by myself and see how it goes🤞 |
Can you please just make a nuget package for them? I am really new to git and would definitely mess up in attempting to build and link everything myself. Having a nuget package for the other libraries would be a massive help for me and others. |
Seconding the request for this. Installing the C++ tooling required to get the cimplot library built and referencing everything correctly is sufficiently complicated compared to pulling it down from Nuget. |
Would be really good to have it. Also, as |
Can you add ImGuizmo and ImGuiPlot to the Nuget version or show a tutorial of how to add them?
The text was updated successfully, but these errors were encountered: