Add a better PlotHistogram overload, and deprecate the old one.

internals
Eric Mellino 7 years ago
parent 2a0eeffb19
commit dd2e085179
  1. 37
      src/ImGui.NET/ImGui.cs

@ -294,7 +294,16 @@ namespace ImGuiNET
ImGuiNative.igShowFontSelector(label); ImGuiNative.igShowFontSelector(label);
} }
public unsafe static void PlotHistogram(string label, float[] values, int valuesOffset, string overlayText, float scaleMin, float scaleMax, Vector2 graphSize, int stride) [Obsolete("This PlotHistogram overload is deprecated. Use the overload accepting a startIndex and count.")]
public unsafe static void PlotHistogram(
string label,
float[] values,
int valuesOffset,
string overlayText,
float scaleMin,
float scaleMax,
Vector2 graphSize,
int stride)
{ {
fixed (float* valuesBasePtr = values) fixed (float* valuesBasePtr = values)
{ {
@ -311,6 +320,32 @@ namespace ImGuiNET
} }
} }
public unsafe static void PlotHistogram(
string label,
float[] values,
int startIndex,
int count,
string overlayText = null,
float scaleMin = float.MaxValue,
float scaleMax = float.MaxValue,
Vector2 graphSize = default(Vector2),
int elementStride = sizeof(float))
{
fixed (float* valuesBasePtr = values)
{
ImGuiNative.igPlotHistogram(
label,
valuesBasePtr,
count,
startIndex,
overlayText,
scaleMin,
scaleMax,
graphSize,
elementStride * sizeof(float));
}
}
public static bool SliderFloat(string sliderLabel, ref float value, float min, float max, string displayText, float power) public static bool SliderFloat(string sliderLabel, ref float value, float min, float max, string displayText, float power)
{ {
return ImGuiNative.igSliderFloat(sliderLabel, ref value, min, max, displayText, power); return ImGuiNative.igSliderFloat(sliderLabel, ref value, min, max, displayText, power);

Loading…
Cancel
Save