From 0f536569527ec0a0ad6f90c22d0908681114661f Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 18 Dec 2024 20:18:27 +0100 Subject: [PATCH] build: Small ImPlot3D fixes to make it build on all platforms --- lib/third_party/imgui/implot3d/source/implot3d.cpp | 2 ++ lib/third_party/imgui/implot3d/source/implot3d_demo.cpp | 2 +- lib/third_party/imgui/implot3d/source/implot3d_items.cpp | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/third_party/imgui/implot3d/source/implot3d.cpp b/lib/third_party/imgui/implot3d/source/implot3d.cpp index 2a30ef062..7a51e6d01 100644 --- a/lib/third_party/imgui/implot3d/source/implot3d.cpp +++ b/lib/third_party/imgui/implot3d/source/implot3d.cpp @@ -51,6 +51,8 @@ #include "implot3d.h" #include "implot3d_internal.h" +#include + #ifndef IMGUI_DISABLE //----------------------------------------------------------------------------- diff --git a/lib/third_party/imgui/implot3d/source/implot3d_demo.cpp b/lib/third_party/imgui/implot3d/source/implot3d_demo.cpp index c06721e5b..b4fb1a3ed 100644 --- a/lib/third_party/imgui/implot3d/source/implot3d_demo.cpp +++ b/lib/third_party/imgui/implot3d/source/implot3d_demo.cpp @@ -291,7 +291,7 @@ void DemoSurfacePlots() { int idx = i * N + j; xs[idx] = range_min + j * step; // X values are constant along rows ys[idx] = range_min + i * step; // Y values are constant along columns - zs[idx] = sinf(std::sqrt(xs[idx] * xs[idx] + ys[idx] * ys[idx])); // Z = sin(sqrt(X^2 + Y^2)) + zs[idx] = sinf(sqrt(xs[idx] * xs[idx] + ys[idx] * ys[idx])); // Z = sin(sqrt(X^2 + Y^2)) } } diff --git a/lib/third_party/imgui/implot3d/source/implot3d_items.cpp b/lib/third_party/imgui/implot3d/source/implot3d_items.cpp index 8b7d637ce..e5ce610bb 100644 --- a/lib/third_party/imgui/implot3d/source/implot3d_items.cpp +++ b/lib/third_party/imgui/implot3d/source/implot3d_items.cpp @@ -702,6 +702,9 @@ template struct RendererSurfaceFill : RendererBase { RendererSurfaceFill(const _Getter& getter, int x_count, int y_count, ImU32 col) : RendererBase((x_count - 1) * (y_count - 1), 6, 4), Getter(getter), + UV({}), + Min(0.0f), + Max(0.0f), XCount(x_count), YCount(y_count), Col(col) {}