From 0fb3346a7aaadf72f76199e8ca239d5da08bc1f1 Mon Sep 17 00:00:00 2001 From: sergeyn Date: Tue, 24 Aug 2021 17:08:00 +0200 Subject: [PATCH 1/2] custom context management (same way as in ImGui) (#278) --- implot.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/implot.cpp b/implot.cpp index bc1022e..5f6b9ce 100644 --- a/implot.cpp +++ b/implot.cpp @@ -85,8 +85,9 @@ You can read releases logs https://github.com/epezent/implot/releases for more d #endif // Global plot context +#ifndef GImPlot ImPlotContext* GImPlot = NULL; - +#endif //----------------------------------------------------------------------------- // Struct Implementations //----------------------------------------------------------------------------- From 14d4c96d0c169198e60079d467111139b47242f5 Mon Sep 17 00:00:00 2001 From: Dario Mambro Date: Sat, 28 Aug 2021 16:00:47 +0200 Subject: [PATCH 2/2] more flexible custom context management (#281) --- implot_internal.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/implot_internal.h b/implot_internal.h index 2100978..802cf35 100644 --- a/implot_internal.h +++ b/implot_internal.h @@ -92,8 +92,9 @@ struct ImPlotNextPlotData; //----------------------------------------------------------------------------- // [SECTION] Context Pointer //----------------------------------------------------------------------------- - +#ifndef GImPlot extern IMPLOT_API ImPlotContext* GImPlot; // Current implicit context pointer +#endif //----------------------------------------------------------------------------- // [SECTION] Generic Helpers