v1.80
版本发布时间: 2021-01-22 03:41:33
ocornut/imgui最新发布版本:v1.91.3(2024-10-04 21:48:34)
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!
Homepage: https://github.com/ocornut/imgui Release notes: https://github.com/ocornut/imgui/releases Wiki: https://github.com/ocornut/imgui/wiki for bindings, links, extensions etc. FAQ: https://www.dearimgui.org/faq/ Discord server: https://discord.dearimgui.org Issues and support: https://github.com/ocornut/imgui/issues
Did you know? We have a Wiki! It is a bit clunky but has sections such as this Useful Widgets gallery!
Thank you!
Ongoing work on Dear ImGui is currently financially supported by:
- Platinum sponsors: Blizzard + another unnamed benefactor.
- Also recently supported by Kylotonn, RAD Game Tools, Arkane Studios, and more.
Huge thank you to all past and present supporters! Tables have been a LONG time in the making (since early 2019).
Dear ImGui is funded by your contributions and really needs them right now. If your company uses Dear ImGui, consider reaching out. See Sponsors page for details.
TABLES
Finally Tables are merged in master!
Please note the Tables API is still in Beta. What it means is we are sliiiightly more likely than usual to make small changes to the API. If we do they'll be cautious, documented, with redirecting helpers, as usual. If you update to 1.80, consider updating (later) to 1.81 and 1.82 to make sure you catch up with those future changes sooner rather than later. Important: If you used the Tables branch before 1.80, it is strongly suggested that you update today as we make several breaking changes to the API in the second half of 2020.
Absurdly tall screenshot:
(using font: NotoSans-Regular.ttf
at 16.0f size, rendered with imgui_freetype.
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.)
- Added
imgui_tables.cpp
file! Manually constructed project files will need the new file added! (#3740) - Backends: moved all backends files (
imgui_impl_XXXX.cpp
,imgui_impl_XXXX.h
) from examples/ to backends/. (#3513) - Renamed
ImDrawList::AddBezierCurve()
toImDrawList::AddBezierCubic()
. Kept inline redirection function (will obsolete). - Renamed
ImDrawList::PathBezierCurveTo()
toImDrawList::PathBezierCubicCurveTo()
. Kept inline redirection function (will obsolete). - Removed redirecting functions/enums names that were marked obsolete in 1.60 (April 2018):
-
io.RenderDrawListsFn
pointer -> useImGui::GetDrawData()
value and call the render function of your backend -
ImGui::IsAnyWindowFocused()
-> useImGui::IsWindowFocused(ImGuiFocusedFlags_AnyWindow)
-
ImGui::IsAnyWindowHovered()
-> useImGui::IsWindowHovered(ImGuiHoveredFlags_AnyWindow)
-
ImGuiStyleVar_Count_
-> useImGuiStyleVar_COUNT
-
ImGuiMouseCursor_Count_
-> useImGuiMouseCursor_COUNT
-
- Removed redirecting functions/enums names that were marked obsolete in 1.61 (May 2018):
-
InputFloat (... int decimal_precision ...)
-> useInputFloat(... const char* format ...)
withformat = "%.Xf"
where X was value for decimal_precision. - same for
InputFloat2()
/InputFloat3()
/InputFloat4()
variants taking aint decimal_precision
parameter.
-
- Removed redirecting functions/enums names that were marked obsolete in 1.63 (August 2018):
-
ImGui::IsItemDeactivatedAfterChange()
-> useImGui::IsItemDeactivatedAfterEdit()
-
ImGuiCol_ModalWindowDarkening
-> useImGuiCol_ModalWindowDimBg
-
ImGuiInputTextCallback
-> useImGuiTextEditCallback
-
ImGuiInputTextCallbackData
-> useImGuiTextEditCallbackData
-
- Internals: Columns: renamed undocumented/internals
ImGuiColumnsFlags_*
toImGuiOldColumnFlags_*
to reduce confusion with Tables API. Keep redirection enums (will obsolete). (#125, #513, #913, #1204, #1444, #2142, #2707) - Renamed
io.ConfigWindowsMemoryCompactTimer
toio.ConfigMemoryCompactTimer
as the feature now applies to other data structures. (#2636)
All Changes
- Tables: added new Tables Beta API as a replacement for old Columns. (#3740, #2957, #125)
Check out `Demo->Tables for many demos.
Read API comments in imgui.h for details. Read extra commentary in imgui_tables.cpp.
- Added 16 functions:
-
BeginTable()
,EndTable()
-
TableNextRow()
,TableNextColumn()
,TableSetColumnIndex()
-
TableSetupColumn()
,TableSetupScrollFreeze()
-
TableHeadersRow()
,TableHeader()
-
TableGetRowIndex()
,TableGetColumnCount()
,TableGetColumnIndex()
,TableGetColumnName()
,TableGetColumnFlags()
-
TableGetSortSpecs()
,TableSetBgColor()
-
- Added 3 flags sets:
-
ImGuiTableFlags
(29 flags for: features, decorations, sizing policies, padding, clipping, scrolling, sorting etc.) -
ImGuiTableColumnFlags
(24 flags for: width policies, default settings, sorting options, indentation options etc.) -
ImGuiTableRowFlags
(1 flag for: header row)
-
- Added 2 structures:
ImGuiTableSortSpecs
,ImGuiTableColumnSortSpecs
- Added 2 enums:
ImGuiSortDirection
,ImGuiTableBgTarget
- Added 1 style variable:
ImGuiStyleVar_CellPadding
- Added 5 style colors:
ImGuiCol_TableHeaderBg
,ImGuiCol_TableBorderStrong
,ImGuiCol_TableBorderLight
,ImGuiCol_TableRowBg
,ImGuiCol_TableRowBgAlt
.
- Added 16 functions:
- Tab Bar: Made it possible to append to an existing tab bar by calling
BeginTabBar()
/EndTabBar()
again. - Tab Bar: Fixed using more than 128 tabs in a tab bar (scrolling policy recommended).
- Tab Bar: Do not display a tooltip if the name already fits over a given tab. (#3521)
- Tab Bar: Fixed minor/unlikely bug skipping over a button when scrolling left with arrows.
- Tab Bar: Requested ideal content size (for auto-fit) doesn't affect horizontal scrolling. (#3414)
- Drag and Drop: Fix losing drop source Active ID (and often source tooltip) when opening a
TreeNode()
orCollapsingHeader()
while dragging. (#1738) - Drag and Drop: Fix drag and drop to tie same-size drop targets by chosen the later one. Fixes dragging into a full-window-sized dockspace inside a zero-padded window. (#3519, #2717) [@Black-Cat]
- Checkbox: Added
CheckboxFlags()
helper withint*
type (internals have a template version, not exposed). - Clipper: Fixed incorrect end-list positioning when using
ImGuiListClipper
with 1 item (bug in 1.79). (#3663) [@nyorain] - InputText: Fixed updating cursor/selection position when a callback altered the buffer in a way where the byte count is unchanged but the decoded character count changes. (#3587) [@gqw]
- InputText: Fixed switching from single to multi-line while preserving same ID.
- Combo: Fixed using
IsItemEdited()
after Combo() not matching the return value from Combo(). (#2034) - DragFloat, DragInt: very slightly increased mouse drag threshold + expressing it as a factor of default value.
- DragFloat, DragInt: added experimental
io.ConfigDragClickToInputText
feature to enable turning DragXXX widgets into text input with a simple mouse click-release (without moving). (#3737) - Nav: Fixed
IsItemFocused()
from returning false when Nav highlight is hidden because mouse has moved. It's essentially been always the case but it doesn't make much sense. Instead we will aim at exposing feedback and control of keyboard/gamepad navigation highlight and mouse hover disable flag. (#787, #2048) - Metrics: Fixed mishandling of
ImDrawCmd::VtxOffset
in wireframe mesh renderer. - Metrics: Rebranded as "Dear ImGui Metrics/Debugger" to clarify its purpose.
- ImDrawList: Added
ImDrawList::AddQuadBezierCurve()
,ImDrawList::PathQuadBezierCurveTo()
quadratic bezier helpers. (#3127, #3664, #3665) [@aiekick] - Fonts: Updated
GetGlyphRangesJapanese()
to include a larger 2999 ideograms selection of Joyo/Jinmeiyo kanjis, from the previous 1946 ideograms selection. This will consume a some more memory but be generally much more fitting for Japanese display, until we switch to a more dynamic atlas. (#3627) [@vaiorabbit] <- Literally the best-ever pull-request created by mankind. - Log/Capture: fix capture to work on clipped child windows.
- Misc: Made the
ItemFlags
stack shared, so effectively theButtonRepeat
/AllowKeyboardFocus
states (and others exposed in internals such as PushItemFlag) are inherited by stacked Begin/End pairs, vs previously a non-child stacked Begin() would reset those flags back to zero for the stacked window. - Misc: Replaced UTF-8 decoder with one based on branchless one by Christopher Wellons. [@rokups] Super minor fix handling incomplete UTF-8 contents: if input does not contain enough bytes, decoder returns IM_UNICODE_CODEPOINT_INVALID and consume remaining bytes (vs old decoded consumed only 1 byte).
- Misc: Fix format warnings when using gnu printf extensions in a setup that supports them (gcc/mingw). (#3592)
- Misc: Made
EndFrame()
assertion for key modifiers being unchanged during the frame (added in 1.76) more lenient, allowing full mid-frame releases. This is to accommodate the use of mid-frame modal native windows calls, which leads backends such as GLFW to send key clearing events on focus loss. (#3575) - Style: Changed default
style.WindowRounding
value to 0.0f (matches default for multi-viewports). - Style: Reduced the size of the resizing grip, made alpha less prominent.
- Style: Classic: Increase the default alpha value of
WindowBg
to be closer to other styles. - Demo: Clarify usage of right-aligned items in Demo>Layout>Widgets Width.
- Backends: OpenGL3: Use
glGetString(GL_VERSION)
query instead ofglGetIntegerv(GL_MAJOR_VERSION, ...)
when the later returns zero (e.g. Desktop GL 2.x). (#3530) [@xndcn] - Backends: OpenGL2: Backup and restore
GL_SHADE_MODEL
and disableGL_NORMAL_ARRAY
state to increase compatibility with legacy code. (#3671) - Backends: OpenGL3: Backup and restore
GL_PRIMITIVE_RESTART
state. (#3544) [@Xipiryon] - Backends: OpenGL2, OpenGL3: Backup and restore
GL_STENCIL_TEST
enable state. (#3668) - Backends: Vulkan: Added support for specifying which sub-pass to reference during VkPipeline creation. (@3579) [@bdero]
- Backends: DX12: Improve Windows 7 compatibility (for D3D12On7) by loading d3d12.dll dynamically. (#3696) [@Mattiwatti]
- Backends: Win32: Fix setting of
io.DisplaySize
to invalid/uninitialized data after hwnd has been closed. - Backends: OSX: Fix keypad-enter key not working on MacOS. (#3554) [@rokups, @lfnoise]
- Examples: Apple+Metal: Consolidated/simplified to get closer to other examples. (#3543) [@warrenm]
- Examples: Apple+Metal: Forward events down so OS key combination like Cmd+Q can work. (#3554) [@rokups]
- Examples: Emscripten: Renamed
example_emscripten/
toexample_emscripten_opengl3/
. (#3632) - Examples: Emscripten: Added 'make serve' helper to spawn a web-server on localhost. (#3705) [@Horki]
- Examples: DirectX12: Move
ImGui::Render()
call above the first barrier to clarify its lack of effect on the graphics pipe. - CI: Fix testing for Windows DLL builds. (#3603, #3601) [@iboB]
- Docs: Improved the wiki and added a Useful Widgets page. [@Xipiryon]
- Docs: Split examples/README.txt into docs/BACKENDS.md and docs/EXAMPLES.md, and improved them.
- Docs: Consistently renamed all occurrences of "binding" and "back-end" to "backend" in comments and docs.
Other branches & Beta features!
For users of the once-experimental tables branch before 1.80, some of the important changes since 1.78-era:
- (Breaking) Renamed
ImGuiTableFlags_SizingPolicyStretchX
toImGuiTableFlags_SizingStretchSame
. - (Breaking) Renamed
ImGuiTableFlags_SizingPolicyFixedX
toImGuiTableFlags_SizingFixedFit
. - (Breaking) Renamed
ImGuiTableSortSpecsColumn
toImGuiTableColumnSortSpecs
. - (Breaking) Removed
TableGetHoveredColumn()
in favor of usingTableGetColumnFlags() & ImGuiTableColumnFlags_IsHovered
. - (Breaking) Renamed
ImGuiTableFlags_MultiSortable
toImGuiTableFlags_SortMulti
. - (Breaking) Removed
ImGuiTableColumnFlags_WidthAuto
which now can be expressed as_Fixed
+_NoResize
. - (Breaking) Renamed
TableAutoHeaders()
toTableHeadersRow()
. - (Breaking) Replaced
ImGuiTableFlags_ScrollFreezeXXX
flags withTableSetupScrollFreeze()
api. - (Breaking) Renamed
ImGuiTableFlags_NoClipX to
ImGuiTableFlags_NoClip`. - (Breaking) Renamed
bool SpecsChanged
inImGuiTableSortSpecs
tobool SpecsDirty
and made it the user responsability to clear that flag after sorting (you must set it to false yourself). - Omitting many many other changes which should be non-breaking and improvements.
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.
Some of changes from 1.79 in 1.80 related to the docking branch (multi-viewport and docking features) include:
- Docking: Docked windows honor change of tab and text colors. (#2771)
- Docking: Support for appending into existing tab-bar made to work with Docking + internal helper
DockNodeBeginAmendTabBar()
. - Docking: Added experimental
TabItemFlagsOverrideSet
toImGuiWindowClass
. - Viewports: Fixed incorrect whitening of popups above a modal if both use their own viewport.
- Viewports: Backends: Vulkan: Fixed build, removed extraneous pipeline creation (770c9953, e8447dea, 6a0e85c5) (#3459, #3579)
There's a CMake pull-request (#1713) if you prefer a traditional CMake integration over registering sources files in your own project. There's a premake5 branch if you prefer the sane Visual Studio projects generated by premake.
Automation, testing framework, sandbox: (currently in development, available to selected users)
- Tests: Added many thousands lines worth of new regression tests. [@rokups, @Xipiryon, @ocornut]
- TestEngine: Improved capture tools.
- TestEngine: Better support for horizontal scrolling, tab bar, tables in automation. [@rokups, @Xipiryon, @ocornut]
- TestEngine: Countless fixes, tweaks.
- Sandbox: Integrated ImPlot.
ImDrawList Party! (November 2020)
THIS THREAD https://github.com/ocornut/imgui/issues/3606
Somehow, what started as "It'd be fun to organize a contest for writing special effects using the ImDrawList api, with a constraint on source code size. May be fun to see what people can come up with using shape/vector-based api (quite different from a pixel-shading function). Would you participate?"
Led people to an escalating amount of surprise:
Find all sources and many many many more beautiful and crazy entries in https://github.com/ocornut/imgui/issues/3606
Thank you ❤️ @kudaba ❤️ @Fuzznip ❤️ @Crowbarous ❤️ @ShironekoBen ❤️ @heretique ❤️ @42yeah ❤️ @r-lyeh ❤️ @scemino ❤️ @CedricGuillemet ❤️ @PossiblyAShrub ❤️ @Organic-Code ❤️ @pinam45 ❤️ @Fahien ❤️ @badlydrawnrod ❤️ @jv42 ❤️ @andrewwillmott ❤️ @TonyAlbrecht ❤️ @0x1100 ❤️ @ice1000 ❤️ @pmalin ❤️ @BrunoLevy ❤️ @speedoog ❤️ @floooh ❤️ @StephaneMenardais ❤️ @bdero ❤️ @vzaramel ❤️ @Horrowind ❤️ @Seyedof ❤️ @tcantenot ❤️ @Daandelange ❤️ @redream ❤️ @septag ❤️
Gallery
See Gallery threads for more pictures and to post yours!
@Nicify: "nvtool: A ffmpeg-based video encoding tool built with imgui."
@gboisse: "Visual node graph + creative coding with ImGui :)"
@FredrikAleksander: "A fully functional Terminal Emulator widget for ImGui"
@igrekus: "A GUI control tool for a lab RF device QA rig:" Plots are rendered on a Matplotlib surface with ImGUI datascience.
@cmaughan: "A simple profiler. A poor-man's Tracy. I found having it built in and always available makes it into a really useful debug tool." details and code
@mgerhardy: "Remote Behaviour Tree Debugging"
@WerWolv: "A Hex Editor for Reverse Engineers, Programmers and people that value their eye sight when working at 3 AM." https://github.com/WerWolv/ImHex
BeamNG.drive uses imgui for there map editor:
NVIDIA Omniverse got into open-beta. The Omnivers Kit client is written as a layer over Dear ImGui: https://blogs.nvidia.com/blog/2020/12/15/omniverse-open-beta-available/ https://www.nvidia.com/en-us/design-visualization/omniverse/ https://developer.nvidia.com/nvidia-omniverse-platform
@aiekick: ImGuiFontStudio
@AdamENESS: "During the lockdown we had for months in Melbourne, I started to rewrite the entire GUI portion of the custom software we use to Create Interactive Installations. Not a small task, but it brings a breath of fresh air to our software, and moves the software to have a multi-platform Editor Environment, instead of being stuck to windows."
@epezent: "A quick little toy I put together while working on some DSP algorithms. Using ImGui and ImPlot."