Skip to content

Commit 419a8a0

Browse files
committed
Added support for IMGUI_DISABLE. (#563)
1 parent 9be7915 commit 419a8a0

File tree

5 files changed

+17
-4
lines changed

5 files changed

+17
-4
lines changed

implot.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ You can read releases logs https://github.com/epezent/implot/releases for more d
129129
#define IMGUI_DEFINE_MATH_OPERATORS
130130
#endif
131131
#include "implot.h"
132+
#ifndef IMGUI_DISABLE
132133
#include "implot_internal.h"
133134

134135
#include <stdlib.h>
@@ -5885,3 +5886,5 @@ bool BeginPlot(const char* title, const char* x_label, const char* y1_label, con
58855886
#endif
58865887

58875888
} // namespace ImPlot
5889+
5890+
#endif // #ifndef IMGUI_DISABLE

implot.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646

4747
#pragma once
4848
#include "imgui.h"
49+
#ifndef IMGUI_DISABLE
4950

5051
//-----------------------------------------------------------------------------
5152
// [SECTION] Macros and Defines
@@ -1294,4 +1295,5 @@ IMPLOT_DEPRECATED( IMPLOT_API bool BeginPlot(const char* title_id,
12941295

12951296
} // namespace ImPlot
12961297

1297-
#endif
1298+
#endif // #ifndef IMPLOT_DISABLE_OBSOLETE_FUNCTIONS
1299+
#endif // #ifndef IMGUI_DISABLE

implot_demo.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#endif
2929

3030
#include "implot.h"
31+
#ifndef IMGUI_DISABLE
3132
#include <math.h>
3233
#include <stdio.h>
3334
#include <stdlib.h>
@@ -2477,3 +2478,5 @@ void PlotCandlestick(const char* label_id, const double* xs, const double* opens
24772478
}
24782479

24792480
} // namespace MyImplot
2481+
2482+
#endif // #ifndef IMGUI_DISABLE

implot_internal.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@
3131

3232
#pragma once
3333

34-
#include <time.h>
35-
#include "imgui_internal.h"
36-
3734
#ifndef IMPLOT_VERSION
3835
#error Must include implot.h before implot_internal.h
3936
#endif
4037

38+
#ifndef IMGUI_DISABLE
39+
#include <time.h>
40+
#include "imgui_internal.h"
4141

4242
// Support for pre-1.84 versions. ImPool's GetSize() -> GetBufSize()
4343
#if (IMGUI_VERSION_NUM < 18303)
@@ -1667,3 +1667,5 @@ void Locator_Log10(ImPlotTicker& ticker, const ImPlotRange& range, float pixels,
16671667
void Locator_SymLog(ImPlotTicker& ticker, const ImPlotRange& range, float pixels, bool vertical, ImPlotFormatter formatter, void* formatter_data);
16681668

16691669
} // namespace ImPlot
1670+
1671+
#endif // #ifndef IMGUI_DISABLE

implot_items.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#define IMGUI_DEFINE_MATH_OPERATORS
2727
#endif
2828
#include "implot.h"
29+
#ifndef IMGUI_DISABLE
2930
#include "implot_internal.h"
3031

3132
//-----------------------------------------------------------------------------
@@ -2808,3 +2809,5 @@ void PlotDummy(const char* label_id, ImPlotDummyFlags flags) {
28082809
}
28092810

28102811
} // namespace ImPlot
2812+
2813+
#endif // #ifndef IMGUI_DISABLE

0 commit comments

Comments
 (0)