I've been trying different overloads of PlotLine, but all of them fail with AccessViolationException. And there's just too many overloads to check all of them, VS doesn't display a tooltip with overloads, decompilation takes minutes, and even looking at decompiled ImPlot code makes my PC burn.
The code I'm using is:
private double[] x_axis = new double[512];
private double[] P_left = new double[512];
private double[] P_right = new double[512];
public PressureEqualization()
{
for(int i = 0; i < x_axis.Length; i++)
{
x_axis[i] = i / 512d;
P_left[i] = 0.5 + 0.5 * Math.Sin(2 * Math.PI * x_axis[i]);
P_right[i] = 0.5 + 0.5 * Math.Cos(2 * Math.PI * x_axis[i]);
}
}
public unsafe override void Draw()
{
ImPlot.SetNextAxesToFit();
if (ImPlot.BeginPlot("asdf"))
{
fixed (double* P_left_ptr = P_left)
{
ImPlot.PlotLine("P_left", P_left_ptr, 5);
}
// this fails too:
//ImPlot.PlotLine("P_right", ref x_axis[0], ref P_right[0], 512, 0);
}
ImPlot.EndPlot();
}
I've been trying different overloads of PlotLine, but all of them fail with AccessViolationException. And there's just too many overloads to check all of them, VS doesn't display a tooltip with overloads, decompilation takes minutes, and even looking at decompiled ImPlot code makes my PC burn.
The code I'm using is: