v1.88
版本发布时间: 2022-06-22 00:37:52
ocornut/imgui最新发布版本:v1.91.3(2024-10-04 21:48:34)
1.88: Summer maintainance release!
Reading the changelog is a good way to keep up to date with the things Dear ImGui has to offer, and maybe will give you ideas of some features that you've been ignoring until now!
Homepage: https://github.com/ocornut/imgui Release notes: https://github.com/ocornut/imgui/releases Wiki: https://github.com/ocornut/imgui/wiki for bindings, extensions, links, etc. FAQ: https://www.dearimgui.org/faq/ Issues: https://github.com/ocornut/imgui/issues
Did you know? We have a Wiki! It has sections such as this Useful Extensions Gallery! 👌
📢 Updating from <1.86 and got visual glitches with custom/old backend when using CTRL+Tab or Modal Windows? See 1.86 release note.
Thank you!
Special thanks to @rokups for their continued work on stuff that are still not visible e.g. regression tests. Special thanks to @PathogenDavid for their continued contributions and helping with github answers.
Ongoing work on Dear ImGui is currently financially supported by companies such as:
- Platinum sponsors: Blizzard
- Chocolate sponsors: Adobe, Google, Ubisoft, Supercell
- Salty-caramel sponsors: Kylotonn, Wonderland Engine
Huge thank you to all past and present supporters!
Dear ImGui is funded by your contributions and needs them right now. If your company uses Dear ImGui, consider reaching out. See Sponsors page for details.
TL;DR;
This is a general "many things" release. Initially I was expecting 1.88 to include new features for input ownership and input routing but it's not ready and we haven't had a release for a while. Among the 80+ changes, some that may interest more people:
- Various fixes related to the 1.87 input io/queue changes.
- Debug: Added of a "Dear ImGui Debug Log" window facilitating looking into common issues (e.g. focus change, popup closure, active id being stolen, etc.).
- Debug: Added a "UTF-8 Encoding Viewer" in Metrics and
DebugTextEncoding()
function to help validating UTF-8 code since many users have issues with UTF-8 encoding and C++ makes things difficult. - Sliders: Clicking within the grab/knob of a non-Drag Slider width doesn't alter current value.
- InputText: Fixed undo-state corruptions when altering in-buffers in user callback and in other cases.
- Tables: Fixed a rather frequent draw-call merging issues (some tables created an unnecessary extra draw-call).
- Fixed subtle or rare nav and focus issues.
- Many backends fixes (including tentative fixes for frequent OpenGL issues on Windows in multi-viewport mode).
- Various Docking and Multi-viewport fixes.
Some of the debug tools
Breaking Changes
(Suggestion: once in a while, add #define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
in your imconfig.h
file to make sure you are not using to-be-obsoleted symbols.)
- Renamed
IMGUI_DISABLE_METRICS_WINDOW to
IMGUI_DISABLE_DEBUG_TOOLS` for correctness. Kept support for old define (will obsolete). - Renamed
CaptureMouseFromApp()
andCaptureKeyboardFromApp()
toSetNextFrameWantCaptureMouse()
andSetNextFrameWantCaptureKeyboard()
to clarify purpose, old name was too misleading. Kept inline redirection functions (will obsolete). - Renamed
ImGuiKeyModFlags
toImGuiModFlags
. Kept inline redirection enums (will obsolete). (This was never used in public API functions but technically present in imgui.h and ImGuiIO). - Backends: OSX: Removed
ImGui_ImplOSX_HandleEvent()
from backend API in favor of backend automatically handling event capture. Examples that are using the OSX backend have removed all the now-unnecessary calls to ImGui_ImplOSX_HandleEvent(), applications can do as well. [@stuartcarnie] (#4821) - Internals: calling
ButtonBehavior()
without callingItemAdd()
now requires aKeepAliveID()
call. This is because theKeepAliveID()
call was moved fromGetID()
toItemAdd()
. (#5181)
Other Changes
- IO: Fixed backward-compatibility regression introduced in 1.87: (#4921, #4858)
- Direct accesses to
io.KeysDown[]
with legacy indices didn't work (with new backends). - Direct accesses to
io.KeysDown[GetKeyIndex(XXX)]
would access invalid data (with old/new backends). - Calling
IsKeyDown()
didn't have those problems, and is recommended asio.KeysDown[]
is obsolete.
- Direct accesses to
- IO: Fixed input queue trickling of interleaved keys/chars events (which are frequent especially when holding down a key as OS submits chars repeat events) delaying key presses and mouse movements. In particular, using the input system for fast game-like actions (e.g. WASD camera move) would typically have been impacted, as well as holding a key while dragging mouse. Constraints have been lifted and are now only happening when e.g. an InputText() widget is active. (#4921, #4858)
- Note that even thought you shouldn't need to disable
io.ConfigInputTrickleEventQueue
, you can technically dynamically change its setting based on the context (e.g. disable only when hovering or interacting with a game/3D view).
- Note that even thought you shouldn't need to disable
- IO: Fixed input queue trickling of mouse wheel events: multiple wheel events are merged, while a mouse pos followed by a mouse wheel are now trickled. (#4921, #4821)
- IO: Added
io.SetAppAcceptingEvents()
to set a master flag for accepting key/mouse/characters events (default to true). Useful if you have native dialog boxes that are interrupting your application loop/refresh, and you want to disable events being queued while your app is frozen. - Windows: Fixed first-time windows appearing in negative coordinates from being initialized with a wrong size. This would most often be noticeable in multi-viewport mode (docking branch) when spawning a window in a monitor with negative coordinates. (#5215, #3414) [@DimaKoltun]
- Clipper: Fixed a regression in 1.86 when not calling clipper.End() and late destructing the clipper instance. High-level languages (Lua,Rust etc.) would typically be affected. (#4822)
- Layout: Fixed mixing up
SameLine()
andSetCursorPos()
together from creating situations where line height would be emitted from the wrong location (e.g. ItemA+SameLine()+SetCursorPos()+ItemB' would emit ItemA worth of height from the position of ItemB, which is not necessarily aligned with ItemA). - Sliders: An initial click within the knob/grab doesn't shift its position. (#1946, #5328)
- Sliders, Drags: Fixed dragging when using hexadecimal display format string. (#5165, #3133)
- Sliders, Drags: Fixed manual input when using hexadecimal display format string. (#5165, #3133)
- InputScalar: Fixed manual input when using %03d style width in display format string. (#5165, #3133)
- InputScalar: Automatically allow hexadecimal input when format is %X (without extra flag).
- InputScalar: Automatically allow scientific input when format is float/double (without extra flag).
- Nav: Fixed nav movement in a scope with only one disabled item from focusing the disabled item. (#5189)
- Nav: Fixed issues with nav request being transferred to another window when calling
SetKeyboardFocusHere()
and simultaneous changing window focus. (#4449) - Nav: Changed
SetKeyboardFocusHere()
to not behave if a drag or window moving is in progress. - Nav: Fixed inability to cancel nav in modal popups. (#5400) [@rokups]
- IsItemHovered(): added
ImGuiHoveredFlags_NoNavOverride
to disable the behavior where the return value is overridden by focus when gamepad/keyboard navigation is active. - InputText: Fixed pressing Tab emitting two tabs characters because of dual Keys/Chars events being trickled with the new input queue (happened on some backends only). (#2467, #1336)
- InputText: Fixed a one-frame display glitch where pressing Escape to revert after a deletion would lead to small garbage being displayed for one frame. Curiously a rather old bug! (#3008)
- InputText: Fixed an undo-state corruption issue when editing main buffer before reactivating item. (#4947)
- InputText: Fixed an undo-state corruption issue when editing in-flight buffer in user callback. (#4947, #4949] [@JoshuaWebb]
- Tables: Fixed incorrect border height used for logic when resizing one of several synchronized instance of a same table ID, when instances have a different height. (#3955).
- Tables: Fixed incorrect auto-fit of parent windows when using non-resizable weighted columns. (#5276)
- Tables: Fixed draw-call merging of last column. Depending on some unrelated settings (e.g. BorderH) merging drawcall of the last column didn't always work (regression since 1.87). (#4843, #4844) [@rokups]
- Inputs: Fixed
IsMouseClicked()
repeat mode rate being half of keyboard repeat rate. - ColorEdit: Fixed text baseline alignment after a
SameLine()
after aColorEdit()
with visible label. - TabBar:
BeginTabItem()
now reacts toSetNextItemWidth()
. (#5262) - TabBar: Tweak shrinking policy so that while resizing tabs that don't need shrinking keep their initial width more precisely (without the occasional +1 worth of width).
- Menus: Adjusted
BeginMenu()
closing logic so hovering void or non-MenuItem() in parent window always lead to menu closure. Fixes using items that are notMenuItem()
orBeginItem()
at the root level of a popup with a child menu opened. - Menus: Menus emitted from the main/scrolling layer are not part of the same menu-set as menus emitted from the menu-bar, avoiding accidental hovering from one to the other. (#3496, #4797) [@rokups]
- Style: Adjust default value of
GrabMinSize
from 10.0f to 12.0f. - Stack Tool: Added option to copy item path to clipboard. (#4631)
- Settings: Fixed out-of-bounds read when .ini file on disk is empty. (#5351) [@quantum5]
- Settings: Fixed some
SetNextWindowPos
/SetNextWindowSize
API calls not marking settings as dirty. - DrawList: Fixed
PathArcTo()
emitting terminating vertices too close to arc vertices. (#4993) [@thedmd] - DrawList: Fixed texture-based anti-aliasing path with RGBA textures (#5132, #3245) [@cfillion]
- DrawList: Fixed divide-by-zero or glitches with Radius/Rounding values close to zero. (#5249, #5293, #3491)
- DrawList: Circle with a radius smaller than 0.5f won't appear, to be consistent with other primitives. [@thedmd]
- Debug: Added
ShowDebugLogWindow()
showing an opt-in synthetic log of principal events (focus, popup, active id changes) helping to diagnose issues. - Debug: Added
DebugTextEncoding()
function to facilitate diagnosing issues when not sure about whether you have a UTF-8 text encoding issue or a font loading issue. [@LaMarche05, @ocornut] - Demo: Add better demo of how to use
SetNextFrameWantCaptureMouse()
/SetNextFrameWantCaptureKeyboard()
. - Metrics: Added a "UTF-8 Encoding Viewer" section using the aforementioned
DebugTextEncoding()
function. - Metrics: Added "InputText" section to visualize internal state (#4947, #4949).
- Misc: Fixed calling
GetID("label")
before a widget emitting this item inside a group (such as InputInt()) from causing an assertion when closing the group. (#5181). - Misc: Fixed
IsAnyItemHovered()
returning false when using navigation. - Misc: Allow redefining IM_COL32_XXX layout macros to facilitate use on big-endian systems. (#5190, #767, #844)
- Misc: Added
IMGUI_STB_SPRINTF_FILENAME
to support custom path to stb_sprintf. (#5068, #2954) [@jakubtomsu] - Misc: Added constexpr to ImVec2/ImVec4 inline constructors. (#4995) [@Myriachan]
- Misc: Updated stb_truetype.h from 1.20 to 1.26 (many fixes). (#5075)
- Misc: Updated stb_textedit.h from 1.13 to 1.14 (our changes so this effectively is a no-op). (#5075)
- Misc: Updated stb_rect_pack.h from 1.00 to 1.01 (minor). (#5075)
- Misc: binary_to_compressed_c tool: Added -nostatic option. (#5021) [@podsvirov]
- ImVector: Fixed erase() with empty range. (#5009) [@thedmd]
- Backends: Vulkan: Don't use
VK_PRESENT_MODE_MAX_ENUM_KHR
as specs state it isn't part of the API. (#5254) - Backends: GLFW: Fixed a regression in 1.87 which resulted in keyboard modifiers events being reported incorrectly on Linux/X11, due to a bug in GLFW. [@rokups]
- Backends: GLFW: Fixed untranslated keys when pressing lower case letters on OSX (#5260, #5261) [@cpichard]
- Backends: SDL: Fixed dragging out viewport broken on some SDL setups. (#5012) [@rokups]
- Backends: SDL: Added support for extra mouse buttons (
SDL_BUTTON_X1
/SDL_BUTTON_X2
). (#5125) [@sgiurgiu] - Backends: SDL, OpenGL3: Fixes to facilitate building on AmigaOS4. (#5190) [@afxgroup]
- Backends: OSX: Monitor NSKeyUp events to catch missing keyUp for key when user press Cmd + key (#5128) [@thedmd]
- Backends: OSX, Metal: Store backend data in a per-context struct, allowing to use these backends with multiple contexts. (#5203, #5221, #4141) [@noisewuwei]
- Backends: Metal: Fixed null dereference on exit inside command buffer completion handler. (#5363, #5365) [@warrenm]
- Backends: OpenGL3: Partially revert 1.86 change of using
glBufferSubData()
: now only done on Windows and Intel GPU, based on querying glGetString(GL_VENDOR). Essentially we got report of accumulating leaks on Intel with multi-viewports when using simple glBufferData() without orphaning, and report of corruptions on other GPUs with multi-viewports when using orphaning and glBufferSubData(), so currently switching technique based on GPU vendor, which unfortunately reinforce the cargo-cult nature of dealing with OpenGL drivers. Navigating the space of mysterious OpenGL drivers is particularly difficult as they are known to rely on application specific whitelisting. (#4468, #3381, #2981, #4825, #4832, #5127). - Backends: OpenGL3: Fix state corruption on OpenGL ES 2.0 due to not preserving
GL_ELEMENT_ARRAY_BUFFER_BINDING
and vertex attribute states. [@rokups] - Examples: Emscripten+WebGPU: Fix building for latest WebGPU specs. (#3632)
- Examples: OSX+Metal, OSX+OpenGL: Removed now-unnecessary calls to
ImGui_ImplOSX_HandleEvent()
. (#4821)
Other branches & Beta features!
The Docking and Multi-viewports features are available in the docking branch, they are in beta but actively maintained and being used by many teams already. Your continuous feedback is always appreciated.
Some of changes from 1.87 to 1.88 related to the docking branch (multi-viewport and docking features) include:
- Docking: Fixed floating docked nodes not being clamped into viewport workrect to stay reachable when
io.ConfigWindowsMoveFromTitleBarOnly
is true and multi-viewports are disabled. (#5044) - Docking: Fixed a regression where moving window would be interrupted after undocking a tab when
io.ConfigDockingAlwaysTabBar
is true. (#5324) [@rokups] - Docking: Fixed incorrect focus highlight on docking node when focusing empty central node or a child window which was manually injected into a dockspace window.
- Docking, Modal: Fixed a crash when opening popup from a parent which is being docked on the same frame. (#5401)
- Viewports: Fixed translating a host viewport from briefly altering the size of AlwaysAutoResize windows. (#5057)
- Viewports: Fixed main viewport size not matching ImDrawData::DisplaySize for one frame during resize when multi-viewports are disabled. (#4900)
- Backends: SDL: Fixed dragging out main viewport broken on some SDL setups. (#5012) [@rokups]
- Backends: OSX: Added support for multi-viewports. [@stuartcarnie, @metarutaiga] (#4821, #2778)
- Backends: Metal: Added support for multi-viewports. [@stuartcarnie, @metarutaiga] (#4821, #2778)
- Examples: OSX+Metal, SDL+Metal, GLFW+Metal: Added support for multi-viewports. [@rokups]
Some of changes from 1.87 to 1.88 related to the range-select branch:
- Fixed a bug using CTRL+Click on multi-select tree nodes.
There's a CMake branch/PR (#1713) if you prefer a traditional CMake integration over registering sources files in your own project. There's a premake5 branch if you prefer Visual Studio projects generated by premake.
Gallery
Below a selection of screenshots from Gallery threads...
Pixel FX Designer 2 https://codemanu.itch.io/particle-fx-designer / https://store.steampowered.com/app/939360/Pixel_FX_Designer/
"FightNJokes is a semi-humorous retro style 2D fighting game made for players with humor" https://twitter.com/fightnjokes
@gboisse: Procedural geometry with ImGui-based nodes:
@sgiurgiu: A Reddit client https://github.com/sgiurgiu/reddit_desktop
@Jaysmito101: TerraForge3D https://github.com/Jaysmito101/TerraForge3D
@Unit520: Hexmap an interactive WebGL/WASM based binary data exploration tool https://unit520.net/hexmap
@plkno1-Tse Date picker
@tksuoran: Early work on resurrecting a small turn by turn strategy game I wrote in the early 90s on Amiga. New in this rewrite is procedural map generation.
@lukaasm EXOR Tools/Model Editor, Benchmark viewer
@mborgerson: Dear ImGui is used for the UI in xemu, an original Xbox emulator
@gan74: The UE5 inspired UI in my engine editor thing, Yave. Nothing too fancy, but I like it clean and simple.
@travishaynes: I'm using ImGui to create a PDF viewer designed for doing quantity takeoff from scaled construction drawings [...]
@DickyQi: MIDI Play and keyboard test base on Timidity and ImGui https://github.com/tanluteam/libmidi.git
@immortalx74: I'm using the ReaImGui bindings to create a guitar/bass MIDI editor for Reaper. https://github.com/immortalx74/Reaffer
@pixtur: Tooll 3 - A realtime animation toolkit https://github.com/still-scene/t3/
@thedemons: Here's a fancy animated UI that's built with an animation library I've been working on. https://user-images.githubusercontent.com/17585270/173690093-5c10dae5-279c-439a-81ab-09f7cf4fe576.mp4
@FunIsDangerous: Hello! I'm developping an IDE, Assembler and Emulator for the CPU Intel 8085. https://github.com/FunIsDangerous/8085_emulator
PS: Dear ImGui is funded by your contributions and needs them right now. If your company uses Dear ImGui, consider reaching out today to say hi! See Sponsors page for details.
PS.2: Scroll back up and read that changelog, it is useful!