ImGui.NET
ImGui.NET copied to clipboard
PlotLine and PlotHistogram cannot be called with float[] array
The current implementation only allows a single float:
PlotHistogram(string label, ref float values, int values_count)
PlotHistogram(string label, ref float values, int values_count, int values_offset)
[...]
PlotLines(string label, ref float values, int values_count)
PlotLines(string label, ref float values, int values_count, int values_offset)
[...]
However, those functions can be called with an array of floats in the original library.
For example, this c++ code cannot be implemented in c#:
static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
ImGui::PlotLines("Curve", arr, IM_ARRAYSIZE(arr));
Pass the array like this:
PlotLines(label, ref arr[0], count)
It should work
Yes, it works! Thank you!
I'll leave this issue open because it's still confusing for newcomers and there should be at least a hint about how to pass the array imo (or I missed something...).
If you don't agree with that, feel free to close the issue. :)