v1.72
版本发布时间: 2019-07-28 09:28:46
ocornut/imgui最新发布版本:v1.91.3(2024-10-04 21:48:34)
Happy summer! This is a general release following 1.71, 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 and Google (welcome Google!) + 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.
Welcoming Adrien Marchand (@LaMarche05) who started spending more time on Dear ImGui, currently contributing to ongoing work the automation/testing system (yet unreleased). Also check out his adventure game Edgar: Bokbok in Boulzac!
Dear ImGui is looking for a technical writer to help writing technical articles, tutorials and documentation. Please reach out if you are interesting in helping! (omarcornut at gmail)
TL;DR;
- Child windows don't get in the way of mouse wheel scrolling!
- Easier to implement scrolling tracking. Various scrolling fixes.
- Various columns fixes (maybe last ones until we switch to the wonderful upcoming Columns V2/Table system!).
- InputText: Support for keypad Enter key (ah!).
- Tools: Added
Metrics>Tools>Item Picker
which is convenient to easily break in debugger at the location an UI item is submitted. Particular useful in large or unknown codebases. (#2673) - Added SDL2+DirectX11 example application because clearly we don't have enough examples! (#2632, #2612, #2482) [@vincenthamm]
- Dozens of other fixes and small additions. Also synched the Docking branch accordingly.
Breaking Changes
- Removed redirecting functions/enums names that were marked obsolete in 1.51 (June 2017). If you were still using the old names, read "API Breaking Changes" section of imgui.cpp to find out the new names or equivalent features.
-
ImGuiCol_Column*
,ImGuiSetCond_*
enums. -
IsItemHoveredRect()
,IsPosHoveringAnyWindow()
,IsMouseHoveringAnyWindow()
,IsMouseHoveringWindow()
functions. -
IMGUI_ONCE_UPON_A_FRAME
macro.
-
- Renamed
ImFontAtlas::CustomRect
toImFontAtlasCustomRect
. Kept redirection typedef (will obsolete). - Removed
TreeAdvanceToLabelPos()
which is rarely used and only doesSetCursorPosX(GetCursorPosX() + GetTreeNodeToLabelSpacing())
. Kept redirection function (will obsolete). (#581, #324)
Please note that functions obsoleted in 1.53 will probably be removed by the end of the year. If your language binding is still on 1.53 please consider updating the bindings (newer bindings are mostly auto-generated, based on the metadata output by cimgui).
Other Changes:
- Scrolling: Made mouse-wheel scrolling lock the underlying window until the mouse is moved again or until a short delay expires (~2 seconds). This allow uninterrupted scroll even if child windows are passing under the mouse cursor. (#2604)
- Scrolling: Mouse wheel scrolling while hovering a child window is automatically forwarded to parent window if ScrollMax is zero on the scrolling axis. Also still the case if ImGuiWindowFlags_NoScrollWithMouse is set (not new), but previously the forwarding would be disabled if ImGuiWindowFlags_NoScrollbar was set on the child window, which is not the case any more. Forwarding can still be disabled by setting ImGuiWindowFlags_NoInputs. (amend #1502, #1380).
- Scrolling: Made it possible for mouse wheel and navigation-triggered scrolling to override a call to SetScrollX()/SetScrollY(), making it possible to use a simpler stateless pattern for auto-scrolling:
// (Submit items..)
if (ImGui::GetScrollY() >= ImGui::GetScrollMaxY()) // If scrolling at the already at the bottom..
ImGui::SetScrollHereY(1.0f); // ..make last item fully visible
- Scrolling: Added
SetScrollHereX()
,SetScrollFromPosX()
for completeness. (#1580) [@kevreco] - Window: Fixed
InnerClipRect
right-most coordinates using wrong padding setting (introduced in 1.71). - Window: Fixed old
SetWindowFontScale()
api value from not being inherited by child window. Added comments about the right way to scale your UI (load a font at the right side, rebuild atlas, scale style). - Scrollbar: Avoid overlapping the opposite side when window (often a child window) is forcibly too small.
- Combo: Hide arrow when there's not enough space even for the square button.
- InputText: Testing for newly added
ImGuiKey_KeyPadEnter
key. (#2677, #2005) [@amc522] - TabBar: Fixed unfocused tab bar separator color (was using
ImGuiCol_Tab
, should useImGuiCol_TabUnfocusedActive
). - Columns: Fixed a regression from 1.71 where the right-side of the contents rectangle within each column
would wrongly use a
WindowPadding.x
instead ofItemSpacing.x
like it always did. (#125, #2666) - Columns: Made the right-most edge reaches up to the clipping rectangle (removing half of WindowPadding.x worth of asymmetrical/extraneous padding, note that there's another half that conservatively has to offset the right-most column, otherwise it's clipping width won't match the other columns). (#125, #2666)
- Columns: Improved honoring alignment with various values of
ItemSpacing.x
andWindowPadding.x
. (#125, #2666) - Columns: Made
GetColumnOffset()
andGetColumnWidth()
behave when there's no column set, consistently with other column functions. (#2683) - InputTextMultiline: Fixed vertical scrolling tracking glitch.
- Word-wrapping: Fixed overzealous word-wrapping when glyph edge lands exactly on the limit. Because of this, auto-fitting exactly unwrapped text would make it wrap. (fixes initial 1.15 commit, 78645a7d).
- Style: Attenuated default opacity of
ImGuiCol_Separator
in Classic and Light styles. - Style: Added
style.ColorButtonPosition
(left/right, defaults to ImGuiDir_Right) to move the color button of ColorEdit3/ColorEdit4 functions to either side of the inputs. - IO: Added
ImGuiKey_KeyPadEnter
and support in various back-ends (previously back-ends would need to specifically redirect key-pad keys to their regular counterpart). This is a temporary attenuating measure until we actually refactor and add whole sets of keys into the ImGuiKey enum. (#2677, #2005) [@amc522] - Misc: Made
Button()
,ColorButton()
not trigger an "edited" event leading toIsItemDeactivatedAfterEdit()
returning true. This also effectively makeColorEdit4()
not incorrect triggerIsItemDeactivatedAfterEdit()
when clicking the color button to open the picker popup. (#1875) - Misc: Added
IMGUI_DISABLE_METRICS_WINDOW
imconfig.h setting to explicitly compile outShowMetricsWindow()
. - Debug, Metrics: Added
Metrics>Tools>Item Picker
tool which allow clicking on a widget to break in the debugger within the item code. The tool calls IM_DEBUG_BREAK() which can be redefined in imconfig.h if needed. - ImDrawList: Fixed
CloneOutput()
helper crashing. (#1860) [@gviot] - ImDrawListSplitter: (and
ImDrawList::ChannelsSplit()
): Fixed an issue with merging draw commands between channel 0 and 1. (#2624) - ImDrawListSplitter: Fixed memory leak when using low-level split api (was not affecting ImDrawList api, also this type was added in 1.71 and not advertised as a public-facing feature).
- Fonts:
binary_to_compressed_c.cpp
: Display an error message if failing to open/read the input font file. - Demo: Log, Console: Using a simpler stateless pattern for auto-scrolling.
- Demo: Widgets: Showing how to use the format parameter of Slider/Drag functions to display the name of an enum value instead of the underlying integer value.
- Backends: DX10/DX11: Backup, clear and restore Geometry Shader is any is bound when calling renderer.
- Backends: DX11: Clear Hull Shader, Domain Shader, Compute Shader before rendering. Not backing/restoring them.
- Backends: OSX: Disabled default native Mac clipboard copy/paste implementation in core library (added in 1.71), because it needs application to be linked with
-framework ApplicationServices
. It can be explicitly enabled back by using#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS
in imconfig.h. Re-added equivalent using NSPasteboard api in the imgui_impl_osx.mm experimental back-end. (#2546) - Backends: SDL2: Added dummy
ImGui_ImplSDL2_InitForD3D()
function to make D3D support more visible. (#2482, #2632) [@josiahmanson] - Examples: Added SDL2+DirectX11 example application. (#2632, #2612, #2482) [@vincenthamm]
Beta features!
The docking (#2109) and multi-viewports (#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. Recent changes to the multi-viewport and docking features:
- Docking: Making it possible to undock a node by clicking on the tab bar / title bar for the node. (#2645).
- Docking: Explicitly inhibit constraint when docked for now. Fix clipping issue related to constraints. (#2690).
- Docking: Fixed dragging/resizing from OS decoration not marking settings as dirty.
- Docking: Renamed
io.ConfigDockingTabBarOnSingleWindows
toio.ConfigDockingAlwaysTabBar
.ImGuiWindowClass::DockingAlwaysTabBar
to set on individual windows. - Docking: Perform simple check: assert if Docking or Viewport are enabled exactly on frame 1 (instead of frame 0 or later), which is a common user error leading to loss of .ini data on load.
- Docking: Fix so that an appearing window making a dock node reappear won't have a zero-size on its first frame.
- Docking: Fixed using
ImGuiDockNodeFlags_AutoHideTabBar
withio.ConfigDockingTabBarOnSingleWindows
. - Docking: Added ImGuiDockNode to .natvis file.
- Docking: Fixed support for large meshes in
GetBackgroundDrawList()
,GetForegroundDrawList()
. (#2638) - Viewport: Fix monitor dpi info not being copied to main viewport when multi-viewports are not enabled. (#2621, #1676)
- Viewport: Refactored ImGuiWindowClass's
ViewportFlagsOverrideMask
+ViewportFlagsOverrideValue
intoViewportFlagsOverrideSet
+ViewportFlagsOverrideClear
which appears easier to grasp. (#1542) - Viewport: Added
ImGuiViewportFlags_NoAutoMerge
to prevent merging into host viewport in a per-window basis via theImGuiWindowClass
override mechanism. (#1542)
There's a CMake pull-request (#1713) if you prefer a traditional CMake integration over registering imgui sources files in your own project. There's a premake5 branch if you prefer the nicer Visual Studio projects generated by premake.
Help wanted!
- Dear ImGui is looking for a technical writer to help writing technical articles, tutorials and documentation. Please reach out if you are interesting in helping!.
- One upcoming project will be to start writing a high quality "sample" game editor application to showcase how a fancy polished dear imgui application may look like (vs the standard demo which is constrained by nature of being embedded within the library).
- Multi-viewports in particular needs help and bug-fixes on Linux and Mac. Specific workarounds for both SDL and GLFW are becoming highly desirable. I am myself not a Linux nor Mac users and those platforms have been lagging behind in term of multi-viewport supports. (#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!
Light Tracer Render (https://lighttracer.org/)
Karnaugh Studio (https://sevcikdaniel.github.io/karnaugh-studio/)
Azure Kinect Viewer (https://docs.microsoft.com/en-us/azure/kinect-dk/azure-kinect-viewer)
"An industrial application used dear-ImGUI,a scheduling system to control several robot and other devices, so fast & cool, and from now on, say goodbye to MFC, thanks Dear-ImGUI." @haohuixin
"ImGui interface for my global illumination playground profiler. I made a custom widget to render task performance breakdown and legend for it, it was pretty enjoyable." @raikiri
Polyscope (http://polyscope.run/)
nnview: neural network viewer (https://github.com/lighttransport/nnview)
RaysimLib (https://github.com/leggedrobotics/raisimLib)