v1.75
版本发布时间: 2020-02-10 21:06: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
Thank you!
Ongoing work on Dear ImGui is currently financially supported by Blizzard, Google, Ubisoft, Nvidia along with Remedy, Next Level Games. Supercell, Framefield, Mobigame, DotEmu, Media Molecule.
We are transitioning toward a B2B model to grow and sustain the project (also see: "What happened in 2019?"). If your company uses Dear ImGui and you would like to meet at GDC 2020, you can reach out to denis at dearimgui.com.
Huge thank you to all past and present supporters!
TL;DR;
- Removed redirecting functions/enums names which were marked obsolete in 1.53 (December 2017).
- Dozens of fixes, e.g. for Ctrl+Tab, InputText, ColorEdit, in backends etc. among other things.
- Made the new Tables API public (#2957), it is now available for testing in a branch and will be merged to master once stabilized (hopefully by next release). Feedback welcome!
- Added
ImDrawList::AddNgon
apis for explicit low-polygon count, in prevision for future version making all circles actually round.ImDrawList::AddCircle
apis can now takes a zero segment count to use auto-tesselation.
Breaking Changes
- Removed redirecting functions/enums names that were marked obsolete in 1.53 (December 2017):
If you were still using the old names, while you are cleaning up, considering enabling
IMGUI_DISABLE_OBSOLETE_FUNCTIONS
in imconfig.h even temporarily to have a pass at finding and removing up old API calls, if any remaining.-
ShowTestWindow()
-> useShowDemoWindow()
-
IsRootWindowFocused()
-> useIsWindowFocused(ImGuiFocusedFlags_RootWindow)
-
IsRootWindowOrAnyChildFocused()
-> useIsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows)
-
SetNextWindowContentWidth(w)
-> useSetNextWindowContentSize(ImVec2(w, 0.0f)
-
GetItemsLineHeightWithSpacing()
-> useGetFrameHeightWithSpacing()
-
ImGuiCol_ChildWindowBg
-> useImGuiCol_ChildBg
-
ImGuiStyleVar_ChildWindowRounding
-> useImGuiStyleVar_ChildRounding
-
ImGuiTreeNodeFlags_AllowOverlapMode
-> useImGuiTreeNodeFlags_AllowItemOverlap
-
IMGUI_DISABLE_TEST_WINDOWS
-> useIMGUI_DISABLE_DEMO_WINDOWS
-
- Removed implicit default parameter to
IsMouseDragging(int button = 0)
to be consistent with other mouse functions (none of the other functions have it). - Obsoleted calling
ImDrawList::PrimReserve()
with a negative count (which was vaguely documented and rarely if ever used). Instead we added an explicit PrimUnreserve() API which can be implemented faster. Also clarified pre-existing constraints which weren't documented (can only unreserve from the last reserve call). If you suspect you ever used that feature before (very unlikely, but grep for call to PrimReserve in your code), you can #define IMGUI_DEBUG_PARANOID in imconfig.h to catch existing calls. [@ShironekoBen] -
ImDrawList::AddCircle()
/AddCircleFilled()
functions don't accept negative radius. - Limiting
Columns()
/BeginColumns()
api to 64 columns with an assert. While the current code technically supports it, future code may not so we're putting the restriction ahead. - imgui_internal.h: changed
ImRect()
default constructor initializes all fields to 0.0f instead of (FLT_MAX,FLT_MAX,-FLT_MAX,-FLT_MAX). If you used ImRect::Add() to create bounding boxes by adding multiple points into it without an explicit initialization, you may need to fix your initial value.
Other Changes
- Inputs: Added
ImGuiMouseButton
enum for convenience (e.g. ImGuiMouseButton_Right=1). We forever guarantee that the existing value will not changes so existing code is free to use 0/1/2. - Nav: Fixed a bug where the initial CTRL-Tab press while in a child window sometimes selected the current root window instead of always selecting the previous root window. (#787)
- ColorEdit: Fix label alignment when using
ImGuiColorEditFlags_NoInputs
. (#2955) [@rokups] - ColorEdit: In HSV display of a RGB stored value, attempt to locally preserve Saturation when Value==0.0 (similar to changes done in 1.73 for Hue). Removed Hue editing lock since those improvements in 1.73 makes them unnecessary. (#2722, #2770). [@rokups]
- ColorEdit: "Copy As" context-menu tool shows hex values with a '#' prefix instead of '0x'.
- ColorEdit: "Copy As" content-menu tool shows hex values both with/without alpha when available.
- InputText: Fix corruption or crash when executing undo after clearing input with ESC, as a byproduct we are allowing to later undo the revert with a CTRL+Z. (#3008).
- InputText: Fix using a combination of
_CallbackResize
(e.g. for std::string binding), along with the_EnterReturnsTrue
flag along with the rarely used property of using an InputText without persisting user-side storage. Previously if you had e.g. a local unsaved std::string and reading result back from the widget, the user string object wouldn't be resized when Enter key was pressed. (#3009) - MenuBar: Fix minor clipping issue where occasionally a menu text can overlap the right-most border.
- Window: Fix
SetNextWindowBgAlpha(1.0f)
failing to override alpha component. (#3007) [@Albog] - Window: When testing for the presence of the
ImGuiWindowFlags_NoBringToFrontOnFocus
flag we test both the focused/clicked window (which could be a child window) and the root window. - ImDrawList:
AddCircle()
,AddCircleFilled()
API can now auto-tessellate when provided a segment count of zero. Alter tessellation quality withstyle.CircleSegmentMaxError
. [@ShironekoBen] - ImDrawList: Add
AddNgon()
,AddNgonFilled()
API with a guarantee on the explicit segment count. In the current branch they are essentially the same asAddCircle()
,AddCircleFilled()
but as we will rework the circle rendering functions to use textures and automatic segment count selection, those new api can fill a gap. [@ShironekoBen] - Columns:
ImDrawList::Channels*
functions now work inside columns. Added extra comments to suggest using user-ownedImDrawListSplitter
instead of ImDrawList functions. [@rokups] - Misc: Added
ImGuiMouseCursor_NotAllowed
enum so it can be used by more shared widgets. [@rokups] - Misc: Added
IMGUI_DISABLE
compile-time definition to make all headers and sources empty. - Misc: Disable format checks when using stb_printf, to allow using extra formats. Made
IMGUI_USE_STB_SPRINTF
a properly documented imconfig.h flag. (#2954) [@loicmolinari] - Misc: Added
misc/single_file/imgui_single_file.h
, We use this to validate compiling all *.cpp files in a same compilation unit. Actual users of that technique (also called "Unity builds") can generally provide this themselves, so we don't really recommend you use this. [@rokups] - CI: Added PVS-Studio static analysis on the continuous-integration server. [@rokups]
- Backends: GLFW, SDL, Win32, OSX, Allegro: Added support for
ImGuiMouseCursor_NotAllowed
. [@rokups] - Backends: GLFW: Added support for the missing mouse cursors newly added in GLFW 3.4+. [@rokups]
- Backends: SDL: Wayland: use SDL_GetMouseState (because there is no global mouse state available on Wayland). (#2800, #2802) [@NeroBurner]
- Backends: GLFW, SDL: report Windows key (io.KeySuper) as always released. Neither GLFW nor SDL can correctly report the key release in every cases (e.g. when using Win+V) causing problems with some widgets. The next release of GLFW (3.4+) will have a fix for it. However since it is both difficult and discouraged to make use of this key for Windows application anyway, we just hide it. (#2976)
- Backends: Win32: Added support for
#define IMGUI_IMPL_WIN32_DISABLE_GAMEPAD
to disable all XInput using code, andIMGUI_IMPL_WIN32_DISABLE_LINKING_XINPUT
to disable linking with XInput,the later may be problematic if compiling with recent Windows SDK and you want your app to run on Windows 7. You can instead try linking with Xinput9_1_0.lib instead. (#2716) - Backends: Glut: Improved FreeGLUT support for MinGW. (#3004) [@podsvirov]
- Backends: Emscripten: Avoid forcefully setting
IMGUI_DISABLE_FILE_FUNCTIONS
. (#3005) [@podsvirov] - Examples: OpenGL: Explicitly adding -DIMGUI_IMPL_OPENGL_LOADER_GL3W to Makefile to match linking settings (otherwise if another loader such as Glew is accessible, the OpenGL3 backend might automatically use it). (#2919, #2798)
- Examples: OpenGL: Added support for glbindings OpenGL loader. (#2870) [@rokups]
- Examples: Emscripten: Demonstrating embedding fonts in Makefile and code. (#2953) [@Oipo]
- Examples: Metal: Wrapped main loop in @autoreleasepool block to ensure allocations get freed even if underlying system event loop gets paused due to app nap. (#2910, #2917) [@bear24rw]
Beta features!
New! The tables (#2957) features is now available for testing. When it stabilize we will merge it to master.
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 + Nav: Fixed messed up Ctrl+Tab order with docked windows.
- Docking + Nav: Fixed failing to restore NavId when refocusing a child within a docked window.
- Docking + Nav: Fixed failing to restore NavId when refocusing due to missing nav window (when it stops being submitted).
- Docking: Fixed a bug where the tab bar of a hidden dockspace would keep requesting focus. (#2960)
- Docking: Added experimental
DockNodeFlagsOverrideSet
/DockNodeFlagsOverrideClear
flags in ImGuiWindowClass (currently experimenting with toolbar idioms). - Viewports: Fix resizing viewport-owning windows when mouse pos is outside the InnerClipRect (can happen with OS decoration on).
- Viewports: Preserve last known size for minimized main viewport to be consistent with secondary viewports. Amend 606175b, d8ab2c1.
- Backends: SDL: Honor NoTaskBarIcon flag under non Win32 OS. (#2117)
- Backends: GLFW, SDL: Platform monitors declared properly even if multi-viewport is not enabled.
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 saner and 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!.
- 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)
- Browsing issues and todo list you may find something something to contribute to!
Gallery
See Gallery threads for more pictures and to post yours!
Rainbow Six https://montreal.ubisoft.com/en/ubisoft-sponsors-user-interface-library-for-c-dear-imgui/
"Ubisoft has used Dear ImGui in the last two years on several AAA projects. Adopted by the Assassin’s Creed team in 2016, and then by Rainbow Six a year later, it has been described by team members as a great tool that enables fast iterations and the empowerment of programmers to create content creation tools and visualization. “Dear ImGui is an elegant immediate mode GUI that fundamentally changes the way that production and debug tools are developed at Ubisoft. This productivity library is an amazingly efficient way to increase the quality of these tools,” says Nicolas Fleury, Technical Architect on Rainbow Six: Siege."
tacit-texview, a texture viewer for game devs by Tristan Grimmer (who made the ProggyClean font used as the fault dear imgui font!) https://github.com/bluescan/tacit-texview
"This viewer is useful for game devs as it displays important information like the presence of an alpha channel and querying specific pixels for their colour." [..] "Support for viewing dds files is implemented -- you can view all mipmaps if they are present, and see cubemaps in a 'T' layout." [..] "Tacit-texview can be used to generate contact sheets for flip-book animation. "
Sculptron https://render.otoy.com/forum/viewtopic.php?f=7&t=73278
nCine game engine https://ncine.github.io/
@ggerganov "Just for lulz: Dear ImGui in a text terminal:" https://github.com/ggerganov/imtui
@AirGuanZ "I have been using Dear ImGui to make a scene editor for my off-line renderer"
LightTracer https://lighttracer.org/ "Public beta of the Light Tracer standalone version is open at http://lighttracer.org! [...] we were able to reuse both GUI and renderer code for web and desktop versions"