Skip to content

Commit

Permalink
update imgui and implot
Browse files Browse the repository at this point in the history
  • Loading branch information
epezent committed Aug 4, 2020
1 parent 4a429c1 commit 024a4c0
Show file tree
Hide file tree
Showing 12 changed files with 7,834 additions and 5,209 deletions.
4,035 changes: 2,251 additions & 1,784 deletions 3rdparty/imgui/imgui.cpp

Large diffs are not rendered by default.

727 changes: 470 additions & 257 deletions 3rdparty/imgui/imgui.h

Large diffs are not rendered by default.

1,898 changes: 1,202 additions & 696 deletions 3rdparty/imgui/imgui_demo.cpp

Large diffs are not rendered by default.

1,121 changes: 747 additions & 374 deletions 3rdparty/imgui/imgui_draw.cpp

Large diffs are not rendered by default.

1,236 changes: 721 additions & 515 deletions 3rdparty/imgui/imgui_internal.h

Large diffs are not rendered by default.

1,106 changes: 680 additions & 426 deletions 3rdparty/imgui/imgui_widgets.cpp

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions 3rdparty/imgui/imstb_truetype.h
Original file line number Diff line number Diff line change
Expand Up @@ -2538,11 +2538,11 @@ static stbtt_int32 stbtt__GetGlyphGPOSInfoAdvance(const stbtt_fontinfo *info, i
// There are no other cases.
STBTT_assert(0);
break;
};
} // [DEAR IMGUI] removed ;
}
}
break;
};
} // [DEAR IMGUI] removed ;

default:
// TODO: Implement other stuff.
Expand Down Expand Up @@ -4132,7 +4132,7 @@ STBTT_DEF void stbtt_PackFontRangesPackRects(stbtt_pack_context *spc, stbrp_rect
STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, stbtt_pack_range *ranges, int num_ranges)
{
stbtt_fontinfo info;
int i,j,n, return_value = 1;
int i,j,n, return_value; // [DEAR IMGUI] removed = 1
//stbrp_context *context = (stbrp_context *) spc->pack_info;
stbrp_rect *rects;

Expand Down
43 changes: 30 additions & 13 deletions 3rdparty/implot/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
# ImPlot
ImPlot is an immediate mode plotting widget for [Dear ImGui](https://github.com/ocornut/imgui). It aims to provide a first-class API that will make ImGui users feel right at home. ImPlot is well suited for visualizing program data in real-time and requires minimal code to integrate. Just like ImGui, it does not burden the end user with GUI state management, avoids STL containers and C++ headers, and has no external dependencies except for ImGui itself.

<img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/controls.gif" width="285"> <img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/dnd.gif" width="285"> <img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/log.gif" width="285">
<img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/controls.gif" width="270"> <img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/dnd.gif" width="270"> <img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/log.gif" width="270">

<img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/bar.gif" width="285"> <img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/query.gif" width="285">
<img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/views.gif" width="285">
<img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/bar.gif" width="270"> <img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/query.gif" width="270">
<img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/views.gif" width="270">

<img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/noise.gif" width="285"> <img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/stock.gif" width="285">
<img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/multiy.gif" width="285">
<img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/noise.gif" width="270"> <img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/stock.gif" width="270">
<img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/multiy.gif" width="270">

## Features

- multiple plot types:
- line
- scatter
- vertical/horizontal bars
- error bars
- line plots
- shaded plots
- scatter plots
- vertical/horizontal bars graphs
- vertical/horizontal error bars
- pie charts
- heatmap charts
- and more likely to come
- mix/match multiple plot items on a single plot
- configurable axes ranges and scaling (linear/log)
- reversible and lockable axes
- support for up to three independent y-axes
- controls for zooming, panning, box selection, and auto-fitting data
- controls for creating persistent query ranges (see demo)
- remappable input controls
- several plot styling options: 10 marker types, adjustable marker sizes, line weights, outline colors, fill colors, etc.
- built-in and user definable colormaps
- optional plot titles, axis labels, and grid labels
- optional legend with toggle buttons to quickly show/hide items
- size-aware grid with smart labels that are always power-of-ten multiples of 1, 2, and 5
Expand Down Expand Up @@ -53,6 +57,17 @@ Consult `implot_demo.cpp` for a comprehensive example of ImPlot's features.

Just add `implot.h`, `implot.cpp`, and optionally `implot_demo.cpp` to your sources. This assumes you already have an ImGui-ready environment. If not, consider trying [mahi-gui](https://github.com/mahilab/mahi-gui), which bundles ImGui, ImPlot, and several other packages for you.

## Special Notes

- If you experience data truncation and/or visual glitches, it is **HIGHLY** recommended that you either:
1) Handle the `ImGuiBackendFlags_RendererHasVtxOffset` flag in your renderer when using 16-bit indices (the official OpenGL3 renderer supports this) and use an ImGui version with patch [imgui@f6120f8](https://github.com/ocornut/imgui/commit/f6120f8e16eefcdb37b63974e6915a3dd35414be).
2) Enable 32-bit indices by uncommenting `#define ImDrawIdx unsigned int` in your `imconfig.h` file.
- By default, no anti-aliasing is done on line plots for performance reasons. If you use 4x MSAA, then you likely won't even notice. However, you can re-enable AA with the `ImPlotFlags_AntiAliased` flag.

## Interactive Demo

An online version of the demo is hosted [here](https://traineq.org/implot_demo/src/implot_demo.html). You can view the plots and the source code that generated them. Note that this demo may not always be up to date and is not as performant as a desktop implemention, but it should give you a general taste of what's possible with ImPlot. Special thanks to [pthom](https://github.com/pthom) for creating and hosting this!

## FAQ

**Q: Why?**
Expand All @@ -77,12 +92,16 @@ A: Yes to y-axes (up to three), "not yet" to x-axes.

**Q: Does ImPlot support [insert plot type]?**

A: Maybe. Check the gallery and demo to see if your desired plot type is shown. If not, consider submitting an issue or better yet, a PR!
A: Maybe. Check the demo, gallery, or [Announcements](https://github.com/epezent/implot/issues/48) to see if your desired plot type is shown. If not, consider submitting an issue or better yet, a PR!

**Q: Does ImPlot support 3D plots?**

A: No, and likely never will since ImGui only deals in 2D rendering.

**Q: My plot lines look like crap!**

A: See the note about anti-aliasing under **Special Notes** above.

**Q: Does ImPlot provide analytic tools?**

A: Not exactly, but it does give you the ability to query plot sub-ranges, with which you can process your data however you like.
Expand All @@ -99,6 +118,4 @@ A: Yes, ImPlot accepts both `float` and `double` for all of its plotting functio

A: Yes, you can use the C binding, [cimplot](https://github.com/cimgui/cimplot) with most high level languages.

## Special Notes
- By default, no anti-aliasing is done on line plots for performance reasons. If you use 4x MSAA, then you likely won't even notice. However, you can re-enable AA with the `ImPlotFlags_AntiAliased` flag.
- If you plan to render several thousands lines or points, then you should consider enabling 32-bit indices by uncommenting `#define ImDrawIdx unsigned int` in your `imconfig.h` file, OR handling the `ImGuiBackendFlags_RendererHasVtxOffset` flag in your renderer (the official OpenGL3 renderer supports this). If you fail to do this, then you may at some point hit the maximum number of indices that can be rendered.

Loading

0 comments on commit 024a4c0

Please sign in to comment.