Skip to content

Commit

Permalink
Added support for IMGUI_DISABLE. (#563)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed Oct 29, 2024
1 parent 9be7915 commit 419a8a0
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
3 changes: 3 additions & 0 deletions implot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ You can read releases logs https://github.com/epezent/implot/releases for more d
#define IMGUI_DEFINE_MATH_OPERATORS
#endif
#include "implot.h"
#ifndef IMGUI_DISABLE
#include "implot_internal.h"

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

} // namespace ImPlot

#endif // #ifndef IMGUI_DISABLE
4 changes: 3 additions & 1 deletion implot.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

#pragma once
#include "imgui.h"
#ifndef IMGUI_DISABLE

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

} // namespace ImPlot

#endif
#endif // #ifndef IMPLOT_DISABLE_OBSOLETE_FUNCTIONS
#endif // #ifndef IMGUI_DISABLE
3 changes: 3 additions & 0 deletions implot_demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#endif

#include "implot.h"
#ifndef IMGUI_DISABLE
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -2477,3 +2478,5 @@ void PlotCandlestick(const char* label_id, const double* xs, const double* opens
}

} // namespace MyImplot

#endif // #ifndef IMGUI_DISABLE
8 changes: 5 additions & 3 deletions implot_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@

#pragma once

#include <time.h>
#include "imgui_internal.h"

#ifndef IMPLOT_VERSION
#error Must include implot.h before implot_internal.h
#endif

#ifndef IMGUI_DISABLE
#include <time.h>
#include "imgui_internal.h"

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

} // namespace ImPlot

#endif // #ifndef IMGUI_DISABLE
3 changes: 3 additions & 0 deletions implot_items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#define IMGUI_DEFINE_MATH_OPERATORS
#endif
#include "implot.h"
#ifndef IMGUI_DISABLE
#include "implot_internal.h"

//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -2808,3 +2809,5 @@ void PlotDummy(const char* label_id, ImPlotDummyFlags flags) {
}

} // namespace ImPlot

#endif // #ifndef IMGUI_DISABLE

0 comments on commit 419a8a0

Please sign in to comment.