v1.61
NB: prefer checking out the latest version from master. The library is fairly stable and issues/regressions are being fixed fast when reported.
v1.61: data types, in-memory settings, font merging improvement, etc.
See https://github.com/ocornut/imgui for the project homepage.
See https://github.com/ocornut/imgui/releases for earlier release notes.
See https://github.com/ocornut/imgui/wiki for language/framework bindings, links, 3rd parties helpers/extensions.
Scroll below for a gallery of screenshots.
Version 1.61 is out! As promised in the previous update, I'll be trying to push smaller and more frequent releases.
Some of the addition in this version include DragScalar
/InputScalar
/SliderScalar
functions to manipulate variety of data types: float/double, signed/unsigned int/long long etc. properly and without any conversion. In addition, some of the integer widgets that were previously lossy with large integers aren't any more. The new functions are relying on the ImGuiDataType
enum to specify the type and are designed for property editors and to minimize the number of additional API entry points. For easy and casual use, the fact that the min/max/step values are passed by address in the generic entry point may be cumbersome. If you frequently use a certain combination of widget/type you may create your own one-line wrappers, e.g.
bool SliderU64(const char *label, u64* value, u64 min = 0, u64 max = 0, const char* format = "%d")
{
return SliderScalar(label, ImGuiDataType_U64, value, &min, &max, format);
}
Or infer types automatically using templates, etc. whatever makes better sense in your code base. Dear ImGui is avoiding templates in the public API to increase portability to other languages, but we could later introduce an optional set of helper headers for willing C++ users.
Functions such as LoadIniSettingsFromMemory()
, SaveIniSettingsToMemory()
have been added to read/write settings from memory instead of relying on file-system functions. You may also use them to seed in default .ini settings for applications where this may be convenient.
Building font atlas has been improved with better support for merging sparse overlapping fonts (such as the new FontAwesome5) and missing glyphs are not taking space in the atlas anymore, which is advantageous when requesting large ranges.
There are a dozen of other changes/fixes which you can find in the full changelog below.
A very unglamorous shot showcasing some data types stuff:
Thank you
Ongoing work on dear imgui is currently being sponsored by Blizzard Entertainment as well as many individual users, hobbyists and professionals on Patreon. See the readme for details. Huge thank you to all of you, past and present supporters! You help has been very meaningful.
How to update
Overwrite every file except imconfig.h (if you modified it). Read the Breaking Changes
section below, and the corresponding log in imgui.cpp. If you have a problem with a missing function/symbols, search for its name in the code, there will likely be a comment about it. Please report any issue to the GitHub page (or on Twitter).
You can also enable IMGUI_DISABLE_OBSOLETE_FUNCTIONS
in imconfig.h to forcefully disable legacy names and symbols. Doing it every once in a while is a good way to make sure you are not using obsolete stuff. Dear ImGui is actively being developed and API changes have a little more frequent lately. They are carefully documented and should not affect everyone. Keeping your copy of dear imgui updated is recommended!
Try to resist the temptation to modify imgui,cpp to not hinder your ability to update often and easily. When needed, you may include imgui_internal.h and implement functions in the ImGui namespace from the comfort of your own files. If you have or need modifications of imgui.cpp, by reaching out you may end up with suggestions for a workaround, or official support for a change.
Breaking Changes
DragInt()
: The default compile-time format string has been changed from "%.0f" to "%d", as we are not using integers internally any more. If you used DragInt() with custom format strings, make sure you change them to use %d or an integer-compatible format. To honor backward-compatibility, the DragInt() code will currently parse and modify format strings to replace%*f
with%d
(while preserving leading and trailing decorations) giving time to users to upgrade their code. If you haveIMGUI_DISABLE_OBSOLETE_FUNCTIONS
enabled, the code will instead assert! You may run a reg-exp search on your codebase for e.g. "DragInt.*%f" to you find them.InputFloat()
: Obsoleted InputFloat() functions taking an optional "int decimal_precision" in favor of an equivalent and more flexible "const char* format", consistent with other functions. Kept redirection functions (will obsolete).- Misc:
IM_DELETE()
helper function added in 1.60 doesn't set the input pointer to NULL, more consistent with standard expectation and allows passing r-values.
All Changes
- Added
DragScalar()
,DragScalarN()
,InputScalar()
,InputScalarN()
,SliderScalar()
,SliderScalarN()
with support for signed/unsigned, 32/64 bits, float/double data types. (#643, #320, #708, #1011) - Window: Fixed pop-ups/tooltips/menus not honoring
style.DisplaySafeAreaPadding
as well as it should have (part of menus displayed outside the safe area, etc.). - Window: Fixed windows using the
ImGuiWindowFlags_NoSavedSettings
flag from not using the same default position as other windows. (#1760) - Window: Relaxed the internal stack size checker to allow Push/Begin/Pop/.../End patterns to be used with
PushStyleColor
,PushStyleVar
,PushFont
without causing a false positive assert. (#1767) - Window: Fixed the default proportional item width lagging by one frame on resize.
- Columns: Fixed a bug introduced in 1.51 where columns would affect the contents size of their container, often creating feedback loops when
ImGuiWindowFlags_AlwaysAutoResize
was used. (#1760) - Settings: Fixed saving an empty .ini file if
CreateContext()
/DestroyContext()
are called without a single call toNewFrame()
. (#1741) - Settings: Added
LoadIniSettingsFromDisk()
,LoadIniSettingsFromMemory()
,SaveIniSettingsToDisk()
,SaveIniSettingsToMemory()
to manually load/save .ini settings. (#923, #993) - Settings: Added
io.WantSaveIniSettings
flag, which is set to notify the application that e.g.SaveIniSettingsToMemory()
should be called. (#923, #993) - Scrolling: Fixed a case where using
SetScrollHere(1.0f
) at the bottom of a window on the same frame the window height has been growing would have the scroll clamped using the previous height. (#1804) - MenuBar: Made
BeginMainMenuBar()
honorstyle.DisplaySafeAreaPadding
so the text can be made visible on TV settings that don't display all pixels. (#1439) [@dougbinks] InputText
: On Mac OS X, filter out characters when the CMD modifier is held. (#1747) [@sivu]InputText
: On Mac OS X, support CMD+SHIFT+Z for Redo. CMD+Y is also supported as major apps seems to default to support both. (#1765) [@lfnoise]InputText
: Fixed returning true when edition is canceled with ESC and the current buffer matches the initial value.InputFloat
,InputFloat2
,InputFloat3
,InputFloat4
: Added variations taking a more flexible and consistent optionalconst char* format
parameter instead ofint decimal_precision
. This allow using custom formats to display values in scientific notation, and is generally more consistent with other API. Obsoleted functions using the optional "int decimal_precision" parameter. (#648)DragFloat
,DragInt
: Cancel mouse tweak when current value is initially past the min/max boundaries and mouse is pushing in the same direction (keyboard/gamepad version already did this).DragFloat
,DragInt
: Honor natural type limits (e.g. INT_MAX, FLT_MAX) instead of wrapping around. (#708, #320)DragFloat
,SliderFloat
: Fixes to allow input of scientific notation numbers when using CTRL+Click to input the value. (~#648, #1011)DragFloat
,SliderFloat
: Rounding-on-write uses the provided format string instead of parsing the precision from the string, which allows for finer uses of%e
%g
etc. (#648, #642)DragFloat
: Improved computation when using the power curve. Improved lost of input precision with very small steps. Added an assert than power-curve requires a min/max range. (~#642)DragFloat
: The 'power' parameter is only honored if the min/max parameter are also setup.DragInt
,SliderInt
: Fixed handling of large integers (we previously passed data around internally as float, which reduced the range of valid integers).ColorEdit
: Fixed not being able to pass theImGuiColorEditFlags_NoAlpha
orImGuiColorEditFlags_HDR
flags toSetColorEditOptions()
.- Nav: Fixed hovering a
Selectable()
with the mouse so that it update the navigation cursor (as it happened in the pre-1.60 navigation branch). (#787) - Style: Changed default
style.DisplaySafeAreaPadding
values from (4,4) to (3,3) so it is smaller thanstyle.FramePadding
and has no effect on main menu bar on a computer. (#1439) - Fonts: When building font atlas, glyphs that are missing in the fonts are not using the glyph slot to render a dummy/default glyph. Saves space and allow merging fonts with overlapping font ranges such as FontAwesome5 which split out the Brands separately from the Solid fonts. (#1703, #1671)
- Misc: Added
IMGUI_CHECKVERSION()
macro to compare version string and data structure sizes in order to catch issues with mismatching compilation unit settings. (#1695, #1769) - Misc: Added
IMGUI_DISABLE_MATH_FUNCTIONS
in imconfig.h to make it easier to redefine wrappers for std/crt math functions. - Misc: Fix to allow compiling in unity builds where stb_rectpack/stb_truetype may be already included in the same compilation unit.
- Demo: Simple Overlay: Added a context menu item to enable freely moving the window.
- Demo: Added demo for DragScalar(), InputScalar(), SliderScalar(). (#643)
- Examples: Calling IMGUI_CHECKVERSION() in the main.cpp of every example application.
- Examples: Allegro 5: Added support for 32-bit indices setup via defining ImDrawIdx, to avoid an unnecessary conversion (Allegro 5 doesn't support 16-bit indices).
- Examples: Allegro 5: Renamed bindings from imgui_impl_a5.cpp to imgui_impl_allegro5.cpp.
- Examples: DirectX 9: Saving/restoring Transform because they don't seem to be included in the StateBlock. Setting shading mode to Gouraud. (#1790, #1687) [@sr-tream]
- Examples: SDL: Fixed clipboard paste memory leak in the SDL binding code. (#1803) [@eliasdaler]
- Various minor fixes, tweaks, refactoring, comments.
Gallery
Some screenshots submitted since 1.60. Please submit pictures or video of your games/applications using dear imgui! See more pictures here > #1607
Also see: Software-using-dear-imgui.
Harfang3D engine (http://harfang3d.com/)
Enjon engine by @MrFrenik
Panorama (https://github.com/ronen25/panorama)