v1.62
v1.62: refactored examples/bindings
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.
TL;DR;
- Examples: Bindings have been refactored to ease combining various platforms/renderer and to ease maintenance. This shouldn't affect your existing integration but if you are feeling like it, it would be a good time to update and look at recent changes. Read below for more details.
- Examples: Added SDL+Vulkan example (which came automatically with the refactor!).
- Examples: Added a FreeGLUT example (with absolutely no reasonable excuse).
- Keyboard navigation now supports Page Up/Page Down. (*)
(Enable keyboard navigation withio.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
) - Added IsItemDeactivated(), IsItemDeactivatedAfterChange() helpers to facilitate handling of application side undo/redo patterns.
- Font: Added GlyphMinAdvanceX/GlyphMaxAdvanceX to ImFontConfig to facilitate tweaking the spacing of specific font range (particularly useful for icons). Added a GetGlyphRangesChineseSimplifiedCommon() helper.
- A dozen of other fixes and additions.
(*) This probably looks simple and minor, but was surprisingly tricky to get right!
Thank you
Ongoing work on dear imgui is currently being sponsored by Blizzard Entertainment as well as dozens of individual users, hobbyists and studios on Patreon. See the readme for details and a more complete list. Huge thank you to all of you, past and present supporters! You help is very meaningful and useful.
How to update
NB: prefer checking out the latest version from master. The library is fairly stable and issues/regressions are being fixed fast when reported.
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).
This specific update (1.62) had the examples bindings reorganized. You may take the chance at updating your bindings and consider using unmodified bindings for some aspect of your engine integration (e.g. use unmodified versions of imgui_impl_win32.cpp, or imgui_impl_glfw.cpp). The advantage of doing so is that you will benefit from multi-viewport support added to standard bindings as we move toward imgui 1.70. Note that your existing bindings and integration should still work.
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!
Breaking Changes
TreeNodeEx()
: The helperImGuiTreeNodeFlags_CollapsingHeader
flag now includeImGuiTreeNodeFlags_NoTreePushOnOpen
. The flag was previously set by the code in CollapsingHeader(). The only difference is if you were bypassing CollapsingHeader() and using TreeNodeEx() manually with ImGuiTreeNodeFlags_CollapsingHeader and without ImGuiTreeNodeFlags_NoTreePushOnOpen. In this case you can remove the ImGuiTreeNodeFlags_NoTreePushOnOpen flag from your call (ImGuiTreeNodeFlags_CollapsingHeader & ~ImGuiTreeNodeFlags_NoTreePushOnOpen
). This also apply if you were using internal's TreeNodeBehavior() with the ImGuiTreeNodeFlags_CollapsingHeader flag directly. (#1864)- ImFontAtlas: Renamed
GetGlyphRangesChinese()
toGetGlyphRangesChineseFull()
to distinguish new smaller variants and discourage using the full set. (#1859)
All Changes
In the examples/ folder:
before: imgui_impl_dx11.cpp --> after: imgui_impl_win32.cpp + imgui_impl_dx11.cpp
before: imgui_impl_dx12.cpp --> after: imgui_impl_win32.cpp + imgui_impl_dx12.cpp
before: imgui_impl_glfw_gl3.cpp --> after: imgui_impl_glfw.cpp + imgui_impl_opengl2.cpp
before: imgui_impl_glfw_vulkan.cpp --> after: imgui_impl_glfw.cpp + imgui_impl_vulkan.cpp
before: imgui_impl_sdl_gl3.cpp --> after: imgui_impl_sdl2.cpp + imgui_impl_opengl2.cpp
before: imgui_impl_sdl_gl3.cpp --> after: imgui_impl_sdl2.cpp + imgui_impl_opengl3.cpp
etc.
- Examples back-ends have been refactored to separate the platform code (e.g. Win32, Glfw, SDL2) from the renderer code (e.g. DirectX11, OpenGL3, Vulkan).
- The "Platform" bindings are in charge of: mouse/keyboard/gamepad inputs, cursor shape, timing, etc.
- The "Renderer" bindings are in charge of: creating the main font texture, rendering imgui draw data.
- The idea is what we can now easily combine and maintain back-ends and reduce code redundancy. Individual files are smaller and more reusable. Integration of imgui into a new/custom engine may also be easier as there is less overlap between "windowing / inputs" and "rendering" code, so you may study or grab one half of the code and not the other.
- This change was motivated by the fact that adding support for the upcoming multi-viewport feature requires more work from the Platform and Renderer back-ends, and the amount of redundancy across files was becoming too difficult to maintain. If you use default back-ends, you'll benefit from an easy update path to support multi-viewports later (for future ImGui 1.7x).
- This is not strictly a breaking change if you keep your old bindings, but when you'll want to fully update your bindings, expect to have to reshuffle a few things.
- Each example still has its own main.cpp which you may refer you to understand how to initialize and glue everything together.
- Some frameworks (such as the Allegro, Marmalade) handle both the "platform" and "rendering" part, and your custom engine may as well.
- Read examples/README.txt for more details.
- Nav: Added support for PageUp/PageDown when keyboard navigation is enabled (explorer-style: first aim at bottom/top most item, when scroll a page worth of contents). (#787)
- Nav: To keep the navigated item in view we also attempt to scroll the parent window as well as the current window. (#787)
- Added
IsItemDeactivated()
to query if the last item was active previously and isn't anymore. Useful for Undo and Redo handling patterns. (#820, #956, #1875) - Added
IsItemDeactivatedAfterChange()
if the last item was active previously, isn't anymore, and during its active state modified a value. Useful for Undo and Redo handling patterns. Note that you may still get false positive (e.g. drag value and while holding return on the same value). (#820, #956, #1875) - Drag and Drop: ColorEdit3, ColorEdit4, ColorButton: Added
ImGuiColorEditFlags_NoDragDrop
flag to disable ColorEdit3/4 as drag target and ColorButton as drag source. (#1826) - Drag and Drop:
BeginDragDropSource()
: Offset tooltip position so it is off the mouse cursor, but also closer to it than regular tooltips, and not clamped by viewport. (#1739) - Drag and Drop:
BeginDragDropTarget()
: AddedImGuiDragDropFlags_AcceptNoPreviewTooltip
flag to request hiding the drag source tooltip from the target site. (#143) - BeginCombo(), BeginMainMenuBar(), BeginChildFrame(): Temporary style modification are restored at the end of BeginXXX instead of EndXXX, to not affect tooltips and child windows.
- Popup: Improved handling of (erroneously) repeating calls to
OpenPopup()
to not close the popup's child popups. (#1497, #1533, #1865). InputTextMultiline()
: Fixed double navigation highlight when scrollbar is active. (#787)InputText()
: Fixed Undo corruption after pasting large amount of text (Redo will still fail when undo buffers are exhausted, but text won't be corrupted).SliderFloat()
: When using keyboard/gamepad and a zero precision format string (e.g. "%.0f"), always step in integer units. (#1866)- ImFontConfig: Added
GlyphMinAdvanceX
/GlyphMaxAdvanceX
settings. Useful to make a font appears monospaced, particularly useful for icon fonts. Mentioned it in misc/fonts/README file. (#1869) - ImFontAtlas: Added
GetGlyphRangesChineseSimplifiedCommon()
helper that returns a list of ~2500 most common Simplified Chinese characters. (#1859) [@JX-Master, @ocornut] - Examples: GLFW: Made it possible to Shutdown/Init the back-end again (by reseting the time storage properly). (#1827) [@ice1000]
- Examples: Win32: Fixed handling of mouse wheel messages to support sub-unit scrolling messages (typically sent by track-pads). (#1874) [@zx64]
- Examples: SDL+Vulkan: Added SDL+Vulkan example.
- Examples: Allegro5: Added support for
ImGuiConfigFlags_NoMouseCursorChange
flag. Added clipboard support. - Examples: Allegro5: Unindexing buffers ourselves as Allegro indexed drawing primitives are buggy in the DirectX9 back-end (will be fixed in Allegro 5.2.5+).
- Examples: DirectX12: Moved the ID3D12GraphicsCommandList* parameter from ImGui_ImplDX12_NewFrame() to ImGui_ImplDX12_RenderDrawData() which makes a lots more sense. (#301)
- Examples: FreeGLUT: Added FreeGLUT bindings. Added FreeGLUT+OpenGL2 example. (#801)
- Examples: Vulkan: Reordered parameters
ImGui_ImplVulkan_RenderDrawData()
to be consistent with other bindings, a good occasion since we refactored the code. - Examples: The functions in imgui_impl_xxx.cpp are prefixed with IMGUI_IMPL_API (which defaults to IMGUI_API) to facilitate some uses. (#1888)
- Examples: Fixed bindings to use ImGuiMouseCursor_COUNT instead of old name ImGuiMouseCursor_Count_ so they can compile with IMGUI_DISABLE_OBSOLETE_FUNCTIONS. (#1887)
- Misc: Updated stb_textedit from 1.09 + patches to 1.12 + minor patches.
- Internals:
PushItemFlag()
flags are inherited by BeginChild().
What's next?
Still working on multi-viewports and docking. Recent other works also include an imgui_impl_osx.mm for native OSX bindings (need help!), and work on a standardized API for range-selection/multi-selection.
Gallery
Recently spotted. You can submit pictures or video of your games/applications using dear imgui!
See more pictures here: #1607 and on the wiki: Software using dear imgui.
Unravel Two (from a glitch in Electronic Arts conference at E3)
Fallout 76 (from The Making of Fallout 76 - Noclip Documentary)
iRacing.com (from technical blog post about their new collision/damage system)