<sub>(This library is available under a free and permissive license, but needs financial support to sustain its continued improvements. In addition to maintenance and stability there are many desirable features yet to be added. If your company is using Dear ImGui, please consider reaching out.)</sub>
@ -97,7 +98,7 @@ Calling the `ImGui::ShowDemoWindow()` function will create a demo window showcas
You should be able to build the examples from sources (tested on Windows/Mac/Linux). If you don't, let us know! If you want to have a quick look at some Dear ImGui features, you can download Windows binaries of the demo app here:
- [imgui-demo-binaries-20190715.zip](http://www.dearimgui.org/binaries/imgui-demo-binaries-20200412.zip) (Windows binaries, 1.76, built 2020/04/12, master branch) or [older demo binaries](http://www.dearimgui.org/binaries).
- [imgui-demo-binaries-20200412.zip](http://www.dearimgui.org/binaries/imgui-demo-binaries-20200412.zip) (Windows, 1.76, built 2020/04/12, master branch) or [older demo binaries](http://www.dearimgui.org/binaries).
The demo applications are not DPI aware so expect some blurriness on a 4K screen. For DPI awareness in your application, you can load/reload your font at different scale, and scale your style with `style.ScaleAllSizes()` (see [FAQ](https://www.dearimgui.org/faq)).
@ -125,7 +126,7 @@ Some of the goals for 2020 are:
- Work on docking. (see [#2109](https://github.com/ocornut/imgui/issues/2109), in public [docking](https://github.com/ocornut/imgui/tree/docking) branch)
- Work on multiple viewports / multiple OS windows. (see [#1542](https://github.com/ocornut/imgui/issues/1542), in public [docking](https://github.com/ocornut/imgui/tree/docking) branch looking for feedback)
- Work on gamepad/keyboard controls. (see [#787](https://github.com/ocornut/imgui/issues/787))
- Work on new Tables API (to replace Columns). (see [#2957](https://github.com/ocornut/imgui/issues/2957))
- Work on new Tables API (to replace Columns). (see [#2957](https://github.com/ocornut/imgui/issues/2957), in public [tables](https://github.com/ocornut/imgui/tree/tables) branch looking for feedback)
- Work on automation and testing system, both to test the library and end-user apps. (see [#435](https://github.com/ocornut/imgui/issues/435))
- Make the examples look better, improve styles, improve font support, make the examples hi-DPI and multi-DPI aware.
@ -144,7 +145,7 @@ Custom engine
### Support, Frequently Asked Questions (FAQ)
Most common questions will be answered by the [Frequently Asked Questions (FAQ)](https://github.com/ocornut/imgui/blob/master/docs/FAQ.md) page.
See: [Frequently Asked Questions (FAQ)](https://github.com/ocornut/imgui/blob/master/docs/FAQ.md) where common questions are answered.
See: [Wiki](https://github.com/ocornut/imgui/wiki) for many links, references, articles.
@ -160,7 +161,7 @@ Private support is available for paying business customers (E-mail: _contact @ d
We occasionally tag [Releases](https://github.com/ocornut/imgui/releases) but it is generally safe and recommended to sync to master/latest. The library is fairly stable and regressions tend to be fixed fast when reported.
You may also peak at the [Multi-Viewport](https://github.com/ocornut/imgui/issues/1542) and [Docking](https://github.com/ocornut/imgui/issues/2109) features in the `docking` branch. Many projects are using this branch and it is kept in sync with master regularly.
Advanced users may want to use the `docking` branch with [Multi-Viewport](https://github.com/ocornut/imgui/issues/1542) and [Docking](https://github.com/ocornut/imgui/issues/2109) features. This branch is kept in sync with master regularly.
**Who uses Dear ImGui?**
@ -219,7 +220,7 @@ Embeds [ProggyClean.ttf](http://upperbounds.net) font by Tristan Grimmer (MIT li
Embeds [stb_textedit.h, stb_truetype.h, stb_rect_pack.h](https://github.com/nothings/stb/) by Sean Barrett (public domain).
Inspiration, feedback, and testing for early versions: Casey Muratori, Atman Binstock, Mikko Mononen, Emmanuel Briney, Stefan Kamoda, Anton Mikhailov, Matt Willis. And everybody posting feedback, questions and patches on the GitHub.
Inspiration, feedback, and testing for early versions: Casey Muratori, Atman Binstock, Mikko Mononen, Emmanuel Briney, Stefan Kamoda, Anton Mikhailov, Matt Willis. Also thank you to everyone posting feedback, questions and patches on GitHub.
@ -189,6 +189,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- docking: C- nav: CTRL+TAB highlighting tabs shows the mismatch between focus-stack and tab-order (not visible in VS because it doesn't highlight the tabs)
- docking: C- after a dock/undock, the Scrollbar Status update in Begin() should use an updated e.g. size_y_for_scrollbars to avoid a 1 frame scrollbar flicker.
- tabs: while dragging/reordering a tab, close button decoration shouldn't appear on other tabs
- tabs: make EndTabBar fail if users doesn't respect BeginTabBar return value, for consistency/future-proofing.
- tabs: persistent order/focus in BeginTabBar() api (#261, #351)
- tabs: TabItem could honor SetNextItemWidth()?
@ -208,7 +209,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- slider: step option (#1183)
- slider style: fill % of the bar instead of positioning a drag.
- knob: rotating knob widget (#942)
- drag float: power/logarithmic slider and drags are weird. (#1316)
- drag float: support for reversed drags (min > max) (removed is_locked, also see fdc526e)
- drag float: up/down axis
- drag float: power != 0.0f with current value being outside the range keeps the value stuck.
- drag float: added leeway on edge (e.g. a few invisible steps past the clamp limits)
ScrollbarRounding=9.0f;// Radius of grab corners rounding for scrollbar
GrabMinSize=10.0f;// Minimum width/height of a grab box for slider/scrollbar
GrabRounding=0.0f;// Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs.
LogSliderDeadzone=4.0f;// The size in pixels of the dead-zone around zero on logarithmic sliders that cross zero.
TabRounding=4.0f;// Radius of upper corners of a tab. Set to 0.0f to have rectangular tabs.
TabBorderSize=0.0f;// Thickness of border around tabs.
TabMinWidthForUnselectedCloseButton=0.0f;// Minimum width for close button to appears on an unselected tab when hovered. Set to 0.0f to always show when hovering, set to FLT_MAX to never show close button unless selected.
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens)
@ -165,6 +165,7 @@ typedef int ImGuiColorEditFlags; // -> enum ImGuiColorEditFlags_ // Flags: f
typedefintImGuiConfigFlags;// -> enum ImGuiConfigFlags_ // Flags: for io.ConfigFlags
typedefintImGuiComboFlags;// -> enum ImGuiComboFlags_ // Flags: for BeginCombo()
typedefintImGuiDockNodeFlags;// -> enum ImGuiDockNodeFlags_ // Flags: for DockSpace()
typedefintImGuiDragFlags;// -> enum ImGuiDragFlags_ // Flags: for DragFloat(), DragInt() etc.
typedefintImGuiDragDropFlags;// -> enum ImGuiDragDropFlags_ // Flags: for BeginDragDropSource(), AcceptDragDropPayload()
typedefintImGuiFocusedFlags;// -> enum ImGuiFocusedFlags_ // Flags: for IsWindowFocused()
typedefintImGuiHoveredFlags;// -> enum ImGuiHoveredFlags_ // Flags: for IsItemHovered(), IsWindowHovered() etc.
@ -172,6 +173,7 @@ typedef int ImGuiInputTextFlags; // -> enum ImGuiInputTextFlags_ // Flags: f
typedefintImGuiKeyModFlags;// -> enum ImGuiKeyModFlags_ // Flags: for io.KeyMods (Ctrl/Shift/Alt/Super)
typedefintImGuiPopupFlags;// -> enum ImGuiPopupFlags_ // Flags: for OpenPopup*(), BeginPopupContext*(), IsPopupOpen()
typedefintImGuiSelectableFlags;// -> enum ImGuiSelectableFlags_ // Flags: for Selectable()
typedefintImGuiSliderFlags;// -> enum ImGuiSliderFlags_ // Flags: for SliderFloat(), SliderInt() etc.
typedefintImGuiTabBarFlags;// -> enum ImGuiTabBarFlags_ // Flags: for BeginTabBar()
typedefintImGuiTabItemFlags;// -> enum ImGuiTabItemFlags_ // Flags: for BeginTabItem()
typedefintImGuiTreeNodeFlags;// -> enum ImGuiTreeNodeFlags_ // Flags: for TreeNode(), TreeNodeEx(), CollapsingHeader()
@ -474,39 +476,45 @@ namespace ImGui
// - CTRL+Click on any drag box to turn them into an input box. Manually input values aren't clamped and can go off-bounds.
// - For all the Float2/Float3/Float4/Int2/Int3/Int4 versions of every functions, note that a 'float v[X]' function argument is the same as 'float* v', the array syntax is just a way to document the number of elements that are expected to be accessible. You can pass address of your first element out of a contiguous set, e.g. &myvector.x
// - Adjust format string to decorate the value with a prefix, a suffix, or adapt the editing and display precision e.g. "%.3f" -> 1.234; "%5.2f secs" -> 01.23 secs; "Biscuit: %.0f" -> Biscuit: 1; etc.
// - Format string may also be set to NULL or use the default format ("%f" or "%d").
// - Speed are per-pixel of mouse movement (v_speed=0.2f: mouse needs to move by 5 pixels to increase value by 1). For gamepad/keyboard navigation, minimum speed is Max(v_speed, minimum_step_at_given_precision).
// - Use v_min < v_max to clamp edits to given limits. Note that CTRL+Click manual input can override those limits.
// - Use v_max = FLT_MAX / INT_MAX etc to avoid clamping to a maximum, same with v_min = -FLT_MAX / INT_MIN to avoid clamping to a minimum.
IMGUI_APIboolDragFloat(constchar*label,float*v,floatv_speed=1.0f,floatv_min=0.0f,floatv_max=0.0f,constchar*format="%.3f",floatpower=1.0f);// If v_min >= v_max we have no bound
// - Legacy: Pre-1.78 there are DragXXX() function signatures that takes a final `float power=1.0f' argument instead of the `ImGuiDragFlags flags=0' argument.
// If you get a warning converting a float to ImGuiDragFlags, read https://github.com/ocornut/imgui/issues/3361
IMGUI_APIboolDragFloat(constchar*label,float*v,floatv_speed=1.0f,floatv_min=0.0f,floatv_max=0.0f,constchar*format="%.3f",ImGuiDragFlagsflags=0);// If v_min >= v_max we have no bound
IMGUI_APIboolDragInt(constchar*label,int*v,floatv_speed=1.0f,intv_min=0,intv_max=0,constchar*format="%d",ImGuiDragFlagsflags=0);// If v_min >= v_max we have no bound
// - CTRL+Click on any slider to turn them into an input box. Manually input values aren't clamped and can go off-bounds.
// - Adjust format string to decorate the value with a prefix, a suffix, or adapt the editing and display precision e.g. "%.3f" -> 1.234; "%5.2f secs" -> 01.23 secs; "Biscuit: %.0f" -> Biscuit: 1; etc.
IMGUI_APIboolSliderFloat(constchar*label,float*v,floatv_min,floatv_max,constchar*format="%.3f",floatpower=1.0f);// adjust format to decorate the value with a prefix or a suffix for in-slider labels or unit display. Use power!=1.0 for power curve sliders
// - Format string may also be set to NULL or use the default format ("%f" or "%d").
// - Legacy: Pre-1.78 there are SliderXXX() function signatures that takes a final `float power=1.0f' argument instead of the `ImGuiSliderFlags flags=0' argument.
// If you get a warning converting a float to ImGuiSliderFlags, read https://github.com/ocornut/imgui/issues/3361
IMGUI_APIboolSliderFloat(constchar*label,float*v,floatv_min,floatv_max,constchar*format="%.3f",ImGuiSliderFlagsflags=0);// adjust format to decorate the value with a prefix or a suffix for in-slider labels or unit display.
// - If you want to use InputText() with std::string or any custom dynamic string type, see misc/cpp/imgui_stdlib.h and comments in imgui_demo.cpp.
@ -1357,6 +1365,28 @@ enum ImGuiColorEditFlags_
#endif
};
// Flags for DragFloat(), DragInt() etc.
enumImGuiDragFlags_
{
ImGuiDragFlags_None=0,
ImGuiDragFlags_InvalidMask_=0x7000000F,// [Internal] We treat using those bits as being potentially a 'float power' argument from the previous API that has got miscast to this enum, and will trigger an assert if needed.
ImGuiDragFlags_ClampOnInput=1<<4,// Clamp value to min/max bounds (if any) when input manually with CTRL+Click. By default CTRL+Click allows going out of bounds.
ImGuiDragFlags_Logarithmic=1<<5,// Make the widget logarithmic (linear otherwise). Consider using ImGuiDragFlags_NoRoundToFormat with this if using a format-string with small amount of digits.
ImGuiDragFlags_NoRoundToFormat=1<<6,// Disable rounding underlying value to match precision of the display format string (e.g. %.3f values are rounded to those 3 digits)
ImGuiDragFlags_NoInput=1<<7// Disable CTRL+Click or Enter key allowing to input text directly into the widget
};
// Flags for SliderFloat(), SliderInt() etc.
enumImGuiSliderFlags_
{
ImGuiSliderFlags_None=0,
ImGuiSliderFlags_InvalidMask_=0x7000000F,// [Internal] We treat using those bits as being potentially a 'float power' argument from the previous API that has got miscast to this enum, and will trigger an assert if needed.
ImGuiSliderFlags_ClampOnInput=1<<4,// Clamp value to min/max bounds when input manually with CTRL+Click. By default CTRL+Click allows going out of bounds.
ImGuiSliderFlags_Logarithmic=1<<5,// Make the widget logarithmic (linear otherwise). Consider using ImGuiSliderFlags_NoRoundToFormat with this if using a format-string with small amount of digits.
ImGuiSliderFlags_NoRoundToFormat=1<<6,// Disable rounding underlying value to match precision of the display format string (e.g. %.3f values are rounded to those 3 digits)
ImGuiSliderFlags_NoInput=1<<7// Disable CTRL+Click or Enter key allowing to input text directly into the widget
};
// Identify a mouse button.
// Those values are guaranteed to be stable and we frequently use 0/1 directly. Named enums provided for convenience.
enumImGuiMouseButton_
@ -1518,6 +1548,7 @@ struct ImGuiStyle
floatScrollbarRounding;// Radius of grab corners for scrollbar.
floatGrabMinSize;// Minimum width/height of a grab box for slider/scrollbar.
floatGrabRounding;// Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs.
floatLogSliderDeadzone;// The size in pixels of the dead-zone around zero on logarithmic sliders that cross zero.
floatTabRounding;// Radius of upper corners of a tab. Set to 0.0f to have rectangular tabs.
floatTabBorderSize;// Thickness of border around tabs.
floatTabMinWidthForUnselectedCloseButton;// Minimum width for close button to appears on an unselected tab when hovered. Set to 0.0f to always show when hovering, set to FLT_MAX to never show close button unless selected.
@ -1789,6 +1820,20 @@ struct ImGuiPayload
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
namespaceImGui
{
// OBSOLETED in 1.78 (from August 2020)
// Old drag/sliders functions that took a 'float power = 1.0' argument instead of flags
staticinlineboolOpenPopupOnItemClick(constchar*str_id=NULL,ImGuiMouseButtonmb=1){returnOpenPopupContextItem(str_id,mb);}// Passing a mouse button to ImGuiPopupFlags is legal
ImGui::SameLine();HelpMarker("Disable rounding underlying value to match precision of the format string (e.g. %.3f values are rounded to those 3 digits).");
ImGui::SameLine();HelpMarker("Disable rounding underlying value to match precision of the format string (e.g. %.3f values are rounded to those 3 digits).");
ImGui::DragScalar("drag float ^2",ImGuiDataType_Float,&f32_v,0.005f,&f32_zero,&f32_one,"%f",2.0f);ImGui::SameLine();HelpMarker("You can use the 'power' parameter to increase tweaking precision on one side of the range.");
ImGuiDragFlags_Vertical =1<<20,// Should this widget be orientated vertically?
ImGuiDragFlags_ReadOnly =1<<21
};
enumImGuiDragFlags_
// Extend ImGuiSliderFlags_
enumImGuiSliderFlagsPrivate_
{
ImGuiDragFlags_None =0,
ImGuiDragFlags_Vertical =1<<0
ImGuiSliderFlags_Vertical =1<<20,// Should this slider be orientated vertically?
ImGuiSliderFlags_ReadOnly =1<<21
};
// Extend ImGuiSelectableFlags_
@ -1293,11 +1299,11 @@ struct ImGuiContext
ImGuiStorageWindowsById;// Map window's ImGuiID to ImGuiWindow*
intWindowsActiveCount;// Number of unique windows submitted by frame
ImGuiWindow*CurrentWindow;// Window being drawn into
ImGuiWindow*HoveredWindow;// Will catch mouse inputs
ImGuiWindow*HoveredRootWindow;// Will catch mouse inputs (for focus/move only)
ImGuiWindow*HoveredWindow;// Window the mouse is hovering. Will typically catch mouse inputs.
ImGuiWindow*HoveredRootWindow;// == HoveredWindow ? HoveredWindow->RootWindow : NULL, merely a shortcut to avoid null test in some situation.
ImGuiWindow*HoveredWindowUnderMovingWindow;// Hovered window ignoring MovingWindow. Only set if MovingWindow is set.
ImGuiDockNode*HoveredDockNode;
ImGuiWindow*MovingWindow;// Track the window we clicked on (in order to preserve focus). The actually window that is moved is generally MovingWindow->RootWindow.
ImGuiWindow*MovingWindow;// Track the window we clicked on (in order to preserve focus). The actual window that is moved is generally MovingWindow->RootWindow.
ImGuiWindow*WheelingWindow;// Track the window we started mouse-wheeling on. Until a timer elapse or mouse has moved, generally keep scrolling the same window even if during the course of scrolling the mouse ends up hovering a child window.
ImVec2WheelingWindowRefMousePos;
floatWheelingWindowTimer;
@ -1448,6 +1454,8 @@ struct ImGuiContext
floatColorEditLastSat;// Backup of last Saturation associated to LastColor[3], so we can restore Saturation in lossy RGB<>HSV round trips
floatColorEditLastColor[3];
ImVec4ColorPickerRef;// Initial/reference color at the time of opening the color picker.
floatSliderCurrentAccum;// Accumulated slider delta when using navigation controls.
boolSliderCurrentAccumDirty;// Has the accumulated slider delta changed since last time we tried to apply it?
boolDragCurrentAccumDirty;
floatDragCurrentAccum;// Accumulator for dragging modification. Always high-precision, not rounded by end-user precision settings
floatDragSpeedDefaultRatio;// If speed == 0.0f, uses (max-min) * DragSpeedDefaultRatio
ImDrawList*DrawList;// == &DrawListInst (for backward compatibility reason with code using imgui_internal.h we keep this a pointer)
ImDrawListDrawListInst;
ImGuiWindow*ParentWindow;// If we are a child _or_ popup window, this is pointing to our parent. Otherwise NULL.
ImGuiWindow*RootWindow;// Point to ourself or first ancestor that is not a child window.
ImGuiWindow*RootWindow;// Point to ourself or first ancestor that is not a child window == Top-level window.
ImGuiWindow*RootWindowDockStop;// Point to ourself or first ancestor that is not a child window. Doesn't cross through dock nodes. We use this so IsWindowFocused() can behave consistently regardless of docking state.
ImGuiWindow*RootWindowForTitleBarHighlight;// Point to ourself or first ancestor which will display TitleBgActive color when this window is active.
ImGuiWindow*RootWindowForNav;// Point to ourself or first ancestor which doesn't have the NavFlattened flag.
@ -1910,12 +1921,13 @@ struct ImGuiTabItem
ImGuiWindow*Window;// When TabItem is part of a DockNode's TabBar, we hold on to a window.
intLastFrameVisible;
intLastFrameSelected;// This allows us to infer an ordered list of the last activated tabs with little maintenance
intNameOffset;// When Window==NULL, offset to name within parent ImGuiTabBar::TabsNames
floatOffset;// Position relative to beginning of tab
floatWidth;// Width currently displayed
floatContentWidth;// Width of actual contents, stored during BeginTabItem() call
ImS16NameOffset;// When Window==NULL, offset to name within parent ImGuiTabBar::TabsNames
boolWantClose;// Marked as closed by SetTabItemClosed()
IMGUI_APIboolTreeNodeBehaviorIsOpen(ImGuiIDid,ImGuiTreeNodeFlagsflags=0);// Consume previous SetNextItemOpen() data, if any. May return true when logging
@ -2249,9 +2261,10 @@ namespace ImGui
// Template functions are instantiated in imgui_widgets.cpp for a finite number of types.
// To use them externally (for custom widget) you may need an "extern template" statement in your code in order to link to existing instances and silence Clang warnings (see #2036).
// e.g. " extern template IMGUI_API float RoundScalarWithFormatT<float, float>(const char* format, ImGuiDataType data_type, float v); "