Skip to content

feat(api): bump ImPlot to v1.0#382

Merged
SpaiR merged 2 commits intoSpaiR:mainfrom
phraktle:feat/implot-v1.0
Apr 21, 2026
Merged

feat(api): bump ImPlot to v1.0#382
SpaiR merged 2 commits intoSpaiR:mainfrom
phraktle:feat/implot-v1.0

Conversation

@phraktle
Copy link
Copy Markdown
Contributor

Upstream implot v1.0 (https://github.com/epezent/implot/releases/tag/v1.0) is a breaking release that replaces per-call (flags, offset, stride) args on every Plot* function with a single ImPlotSpec value-type, and removes the SetNextX-style helpers. The headline new feature is per-index colors and marker sizes via ImPlotSpec arrays (PR epezent/implot#672).

Binding changes:

  • Advance include/implot submodule 1f7a8c0 -> v1.0 (524f9fc)
  • Regenerate ast-implot.json
  • Add ImPlotSpec: scalar @BindingField props plus hand-written native setters for the 5 array-pointer fields (LineColors, FillColors, MarkerSizes, MarkerLineColors, MarkerFillColors). Backing buffers are owned in native memory (ImGui::MemAlloc) and freed on destroy() or on reassignment.
  • Rewrite every Plot* signature: the (flags, offset, stride) tail is replaced by @OptArg @ArgValue(callPrefix="*") ImPlotSpec spec, which marshals to *reinterpret_cast<ImPlotSpec*>(spec.ptr) at the C++ call site. Progressive-cutoff overloads still expose spec-less variants (relying on C++ default = ImPlotSpec()).
  • Add PlotPolygon, PlotBubbles, NextMarker (new in v1.0)
  • Remove SetNextLineStyle / SetNextFillStyle / SetNextMarkerStyle / SetNextErrorBarStyle (obsoleted in v1.0 -- configure ImPlotSpec instead)
  • Trim ImPlotStyle: drop LineWeight/Marker/MarkerSize/MarkerWeight/ FillAlpha/ErrorBarSize/ErrorBarWeight/DigitalBitHeight/ DigitalBitGap (all moved into ImPlotSpec); add new DigitalPadding/DigitalSpacing
  • Flag enums shift accordingly: ImPlotMarker_None is now -2 (ImPlotMarker_Auto = -1 is new); ImPlotCol drops the 5 per-item entries (Line/Fill/MarkerOutline/MarkerFill/ErrorBar); ImPlotStyleVar drops the 9 matching vars; ImPlotLegendFlags gains Reverse; ImPlotPieChartFlags gains Exploding + NoSliceBorder; new ImPlotBubblesFlags / ImPlotPolygonFlags enums are AST-driven.

Example: ExampleImPlot grows a "Per-Index Colors (v1.0 PR #672)" plot showing rainbow LineColors + MarkerFillColors + ramping MarkerSizes.

Note: this is source-incompatible for any caller of the affected Plot* methods or the removed SetNextX helpers. The incompatibility mirrors upstream implot's own v1.0 break and is the minimum footprint to expose the new ImPlotSpec-based API.

Dear ImGui submodule is intentionally left at v1.90.9-docking. implot v1.0 guards its 1.92-era uses (ImTextureRef, ImFontBaked, CalcFontSize) behind #ifdef IMGUI_HAS_TEXTURES / IMGUI_VERSION_NUM and compiles cleanly against 1.90.9.

Type of change

  • Minor changes or tweaks (quality of life stuff)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

@phraktle phraktle mentioned this pull request Apr 20, 2026
5 tasks
phraktle and others added 2 commits April 21, 2026 08:02
…otSpec

Upstream implot v1.0 (https://github.com/epezent/implot/releases/tag/v1.0)
is a breaking release that replaces per-call (flags, offset, stride) args
on every Plot* function with a single ImPlotSpec value-type, and removes
the SetNextX-style helpers. The headline new feature is per-index colors
and marker sizes via ImPlotSpec arrays (PR epezent/implot#672).

Binding changes:
- Advance include/implot submodule 1f7a8c0 -> v1.0 (524f9fc)
- Regenerate ast-implot.json
- Add ImPlotSpec: scalar @BindingField props plus hand-written native
  setters for the 5 array-pointer fields (LineColors, FillColors,
  MarkerSizes, MarkerLineColors, MarkerFillColors). Backing buffers are
  owned in native memory (ImGui::MemAlloc) and freed on destroy() or
  on reassignment.
- Rewrite every Plot* signature: the (flags, offset, stride) tail is
  replaced by `@OptArg @ArgValue(callPrefix="*") ImPlotSpec spec`,
  which marshals to `*reinterpret_cast<ImPlotSpec*>(spec.ptr)` at the
  C++ call site. Progressive-cutoff overloads still expose spec-less
  variants (relying on C++ default `= ImPlotSpec()`).
- Add PlotPolygon, PlotBubbles, NextMarker (new in v1.0)
- Remove SetNextLineStyle / SetNextFillStyle / SetNextMarkerStyle /
  SetNextErrorBarStyle (obsoleted in v1.0 -- configure ImPlotSpec
  instead)
- Trim ImPlotStyle: drop LineWeight/Marker/MarkerSize/MarkerWeight/
  FillAlpha/ErrorBarSize/ErrorBarWeight/DigitalBitHeight/
  DigitalBitGap (all moved into ImPlotSpec); add new
  DigitalPadding/DigitalSpacing
- Flag enums shift accordingly: ImPlotMarker_None is now -2
  (ImPlotMarker_Auto = -1 is new); ImPlotCol drops the 5 per-item
  entries (Line/Fill/MarkerOutline/MarkerFill/ErrorBar);
  ImPlotStyleVar drops the 9 matching vars; ImPlotLegendFlags gains
  Reverse; ImPlotPieChartFlags gains Exploding + NoSliceBorder;
  new ImPlotBubblesFlags / ImPlotPolygonFlags enums are AST-driven.

Example: ExampleImPlot grows a "Per-Index Colors (v1.0 PR #672)" plot
showing rainbow LineColors + MarkerFillColors + ramping MarkerSizes.

Note: this is source-incompatible for any caller of the affected Plot*
methods or the removed SetNextX helpers. The incompatibility mirrors
upstream implot's own v1.0 break and is the minimum footprint to expose
the new ImPlotSpec-based API.

Dear ImGui submodule is intentionally left at v1.90.9-docking. implot
v1.0 guards its 1.92-era uses (ImTextureRef, ImFontBaked, CalcFontSize)
behind `#ifdef IMGUI_HAS_TEXTURES` / `IMGUI_VERSION_NUM` and compiles
cleanly against 1.90.9.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mirror the convention used by plot methods (plotStairsV, plotScatterV,
etc.) which accept a separate length parameter, letting callers pass
a backing array larger than the logical count without having to
Arrays.copyOf to an exactly-sized array per frame.

Added (arr, len) overloads to:
  setLineColors
  setFillColors
  setMarkerSizes
  setMarkerLineColors
  setMarkerFillColors

Motivation: when plotting bubble markers with per-point sizes that
change every frame (trade prints, live signals), the existing
setMarkerSizes(float[]) required an exactly-sized array each call,
defeating any attempt to reuse a growing scratch buffer. The new
overload lets callers keep a single float[] sized to capacity and
pass the current logical length.
@SpaiR SpaiR merged commit 96bb18a into SpaiR:main Apr 21, 2026
7 checks passed
@phraktle phraktle deleted the feat/implot-v1.0 branch April 21, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants