v1.71
版本发布时间: 2019-06-13 00:54:27
ocornut/imgui最新发布版本:v1.91.3(2024-10-04 21:48:34)
Monthly release!
This is a general release following 1.70, keeping with the rhythm of having more frequent, smaller releases. Reading the full 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!
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. Issues and support: https://github.com/ocornut/imgui/issues Technical support for new users: https://discourse.dearimgui.org (also search in GitHub Issues)
Thank you!
Ongoing work on dear imgui is currently being sponsored by Blizzard Entertainment + general & community work by many individual users, hobbyists and studios. See the readme for details. Huge thank you to all of you, past and present supporters! You help is very meaningful.
TL;DR;
- Made it possible to support large meshes (64k+ vertices) while compiling with 16-bit indices, back-end need to set
ImGuiBackendFlags_RendererHasVtxOffset
and honorImDrawCmd::VtxOffset
. Added support for this in most back-ends. - Made
SetNextWindowContentSize()
actually useful (see details below). - Freetype: Support for Monochrome rasterizing which for some fonts can get you high-quality non-AA looking output.
- Fixes for tree nodes, collapsing headers, tab bars, columns inside an horizontally scrolling region.
- Dozens of other fixes and small additions. Also synched the Docking branch accordingly.
Breaking Changes
- IO: changed
io.AddInputCharacter(unsigned short c)
signature toio.AddInputCharacter(unsigned int c)
. - Renamed
SetNextTreeNodeOpen()
toSetNextItemOpen()
. Kept inline redirection function (will obsolete). - Window: rendering of child windows outer decorations (e.g. bg color, border, scrollbars) is now performed as part of their parent window, avoiding the creation of an extraneous draw commands. If you have overlapping child windows with decorations, and relied on their relative z-order to be mapped to submission their order, this will affect your rendering. The optimization is disabled if the parent window has no visual output because it appears to be the most common situation leading to the creation of overlapping child windows. Please reach out if you are affected by this change!
Other Changes:
- Window: clarified behavior of
SetNextWindowContentSize()
. Content size is defined as the size available after removal of WindowPadding on each sides. SoSetNextWindowContentSize(ImVec2(100,100))
+ auto-resize will always allow submitting a 100x100 item without creating a scrollbar, regarding of the WindowPadding value. The exact meaning of ContentSize for decorated windows was previously ill-defined. - Window: Fixed auto-resize with
AlwaysVerticalScrollbar
orAlwaysHorizontalScrollbar
flags. - Window: Fixed one case where auto-resize by double-clicking the resize grip would make either scrollbar appear for a single frame after the resize.
- Separator: Revert 1.70 "Declare its thickness (1.0f) to the layout" change. It's not incorrect but it breaks existing some layout patterns. Will return back to it when we expose Separator flags.
- Fixed
InputScalar
,InputScalarN
,SliderScalarN
,DragScalarN
with non-visible label from insertingstyle.ItemInnerSpacing.x
worth of trailing spacing. - Fixed
InputFloatX
,SliderFloatX
,DragFloatX
functions erroneously reportingIsItemEdited()
multiple times when the text input doesn't match the formatted output value (e.g. input "1" shows "1.000"). It wasn't much of a problem because we typically use the return value instead of IsItemEdited() here. - Fixed uses of
IsItemDeactivated()
,IsItemDeactivatedAfterEdit()
on multi-components widgets and after EndGroup(). (#2550, #1875) - Fixed crash when appending with
BeginMainMenuBar()
more than once and no other window are showing. (#2567) - ColorEdit: Fixed the color picker popup only displaying inputs as HSV instead of showing multiple options. (#2587, broken in 1.69 by #2384).
- CollapsingHeader: Better clipping when a close button is enabled and it overlaps the label. (#600)
- Scrollbar: Minor bounding box adjustment to cope with various border size.
- Scrollbar, Style: Changed default
style.ScrollbarSize
from 16 to 14. - Combo: Fixed rounding not applying with the
ImGuiComboFlags_NoArrowButton flag
. (#2607) [@DucaRii] - Nav: Fixed gamepad/keyboard moving of window affecting contents size incorrectly, sometimes leading to scrollbars appearing during the movement.
- Nav: Fixed rare crash when e.g. releasing Alt-key while focusing a window with a menu at the same frame as clearing the focus. This was in most noticeable in back-ends such as Glfw and SDL which emits key release events when focusing another viewport, leading to Alt+clicking on void on another viewport triggering the issue. (#2609)
- TreeNode, CollapsingHeader: Fixed highlight frame not covering horizontal area fully when using horizontal scrolling. (#2211, #2579)
- TabBar: Fixed
BeginTabBar()
within a window with horizontal scrolling from creating a feedback loop with the horizontal contents size. - Columns: Fixed
Columns()
within a window with horizontal scrolling from not covering the full horizontal area (previously only worked with an explicit contents size). (#125) - Columns: Fixed
Separator()
from creating an extraneous draw command. (#125) - Columns: Fixed
Selectable()
withImGuiSelectableFlags_SpanAllColumns
from creating an extraneous draw command. (#125) - Style: Added
style.WindowMenuButtonPosition
(left/right, defaults to ImGuiDir_Left) to move the collapsing/docking button to the other side of the title bar. - Style: Made window close button cross slightly smaller.
- Log/Capture: Fixed
BeginTabItem()
label not being included in a text log/capture. - ImDrawList: Added
ImDrawCmd::VtxOffset
value to support large meshes (64k+ vertices) using 16-bits indices. The renderer back-end needs to setio.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset
to enable this, and honor theImDrawCmd::VtxOffset
field. Otherwise the value will always be zero. This has the advantage of preserving smaller index buffers and allowing to execute on hardware that do not support 32-bits indices. Most examples back-ends have been modified to support the VtxOffset field. - ImDrawList: Added
ImDrawCmd::IdxOffset
value, equivalent to summing element count for each draw command. This is provided for convenience and consistency with VtxOffset. - ImDrawCallback: Allow to override the signature of
ImDrawCallback
by #define-ing it. This is meant to facilitate custom rendering back-ends passing local render-specific data to the draw callback. - ImFontAtlas: FreeType: Added
RasterizerFlags::Monochrome
flag to disable font anti-aliasing. Combine with RasterizerFlags::MonoHinting for best results. (#2545) [@HolyBlackCat] - ImFontGlyphRangesBuilder: Fixed unnecessarily over-sized buffer, which incidentally was also not fully cleared. Fixed edge-case overflow when adding character 0xFFFF. (#2568). [@NIKE3500]
- Demo: Added full "Dear ImGui" prefix to the title of "Dear ImGui Demo" and "Dear ImGui Metrics" windows.
- Backends: Add native Mac clipboard copy/paste default implementation in core library to match what we are dealing with Win32, and to facilitate integration in custom engines. (#2546) [@andrewwillmott]
- Backends: OSX: imgui_impl_osx: Added mouse cursor support. (#2585, #1873) [@actboy168]
- Examples/Backends: DirectX9/10/11/12, Metal, Vulkan, OpenGL3 (Desktop GL only): Added support for large meshes (64k+ vertices) with 16-bits indices, enable 'ImGuiBackendFlags_RendererHasVtxOffset' in those back-ends.
- Examples/Backends: Don't filter characters under 0x10000 before calling io.AddInputCharacter(), the filtering is done in io.AddInputCharacter() itself. This is in prevision for fuller Unicode support. (#2538, #2541)
Beta features!
The docking (#2109) and multi-viewport (#1542) 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. There's a CMake pull-request (#1713).
Future features!
A sneak peak at what I am currently working on..
Tables (multi-purpose replacement for columns)
Testing suite
Help wanted!
- Multi-viewports in particular needs help on Linux and Mac, and specific workarounds for both SDL and GLFW are becoming highly desirable. (#2117),
- The Vulkan renderer appears to have issues (see vulkan tag)
- The DirectX12 renderer needs multi-viewports support.
- Browsing issues and todo list you may find something something to contribute to!
Gallery
See Gallery threads for more pictures and to post yours!
OpenSage (https://github.com/OpenSAGE/OpenSAGE)
NVIDIA Omniverse viewer (https://developer.nvidia.com/nvidia-omniverse) in motion: https://twitter.com/NVBackchannel/status/1131712329446506497
Unnamed game by @Aarkham
pcsx-redux by @grumpycoders https://github.com/grumpycoders/pcsx-redux
Orbital (https://github.com/AlexAltea/orbital)