Skip to content

v1.51

Compare
Choose a tag to compare
@ocornut ocornut released this 24 Aug 16:45
· 5815 commits to master since this release

v1.51: pick all the colors!

See https://github.com/ocornut/imgui for the project homepage.
See https://github.com/ocornut/imgui/releases for earlier release notes.
Scroll below for a gallery of screenshots.

This release includes a color picker, plenty of new color edit options, columns fixes/improvements, a dozen other fixes or additions, and some much necessary summer cleanup. Initially I wanted this release to include the new styles, which led me to work on some of the remaining styling/border issues.. and it opened multiple can of worms so I stashed that extra work aside for now. Massaging and finishing the color edit/picker api is already worthy of a release tag. Also releases should be more frequent now (maybe one every month?).

// The existing ColorEdit API now allows the user to open a color picker.
// Right-clicking a color widget or picker will also open an option menu.
ImGui::ColorEdit4("My Color", (float*)&col); 

picker_options

I am also soft-launching imgui club, a separate repository to host officially maintained extensions to use with dear imgui. The current repository include an extension to use Freetype for font rasterization (originally submitted by @Vuhdo), and a memory editor applet. More will come!

static MemoryEditor mem_edit;
mem_edit.DrawWindow("Memory Editor", data, data_size);

memory editor

Additionally, remember that the beta gamepad navigation branch (see #787) is pretty much kept up to date with master. Three navigation-branch specific fixes were applied to it since 1.50.

Support future development of dear imgui

This library is free (as in freedom), but needs your support to sustain its development. There are lots of desirable new features and maintenance to do. If you are an individual and want to support dear imgui, you can support development via Monthly donations on Patreon or One-off donations via PayPal. If your company is using dear imgui, please consider financial support (e.g. sponsoring a few weeks/months of development). I can invoice for private support, custom development etc. See Readme for my contact info.)

Patreon: Patreon PayPal: PayPal

How to update

Overwrite every file except imconfig.h (if you have modified it). Check out Breaking Changes section below. If you have a problem with a missing function/symbols, search for its name in the code, there will likely be a comment about it. Please report any issue to the GitHub page!

Breaking Changes

As discussed in the previous release notes (1.50), work on dear imgui has been gradually resuming. It means that fixes and new features should be tackled at a faster rate than last year. However, in order to move forward with the library and get rid of some cruft, I have taken the liberty to be a little bit more aggressive than usual with API breaking changes. Read the details below and search for those names in your code!

In the grand scheme of things, those changes are small and should not affect everyone, but this is technically our most aggressive release so far in term of API breakage. If you want to be extra forward-facing, you can enable #define IMGUI_DISABLE_OBSOLETE_FUNCTIONS in your imconfig.h to disable the obsolete names/redirection.

  • Renamed IsItemHoveredRect() to IsItemRectHovered(). Kept inline redirection function (will obsolete).
  • Renamed IsMouseHoveringWindow() to IsWindowRectHovered() for consistency. Kept inline redirection function (will obsolete).
  • Renamed IsMouseHoveringAnyWindow() to IsAnyWindowHovered() for consistency. Kept inline redirection function (will obsolete).
  • Renamed ImGuiCol_Columns*** enums to ImGuiCol_Separator***. Kept redirection enums (will obsolete).
  • Renamed ImGuiSetCond*** types and enums to ImGuiCond***. Kept redirection enums (will obsolete).
  • Renamed GetStyleColName() to GetStyleColorName() for consistency. Unlikely to be used by end-user!
  • Added PushStyleColor(ImGuiCol idx, ImU32 col) overload, which might cause an "ambiguous call" compilation error if you are using ImColor() with implicit cast. Cast to ImU32 or ImVec4 explicily to fix.
  • Marked the weird IMGUI_ONCE_UPON_A_FRAME helper macro as obsolete. Prefer using the more explicit ImGuiOnceUponAFrame.
  • Changed ColorEdit4(const char* label, float col[4], bool show_alpha = true) signature to ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flags = 0), where flags 0x01 is a safe no-op (hello dodgy backward compatibility!). The new ColorEdit4/ColorPicker4 functions have lots of available flags! Check and run the demo window, under "Color/Picker Widgets", to understand the various new options.
  • Changed signature of ColorButton(ImVec4 col, bool small_height = false, bool outline_border = true) to ColorButton(const char* desc_id, ImVec4 col, ImGuiColorEditFlags flags = 0, ImVec2 size = ImVec2(0,0)). This function was rarely used and was very dodgy (no explicit ID!).
  • Changed BeginPopupContextWindow(bool also_over_items=true, const char* str_id=NULL, int mouse_button=1) signature to (const char* str_id=NULL, int mouse_button=1, bool also_over_items=true). This is perhaps the most aggressive change in this update, but note that the majority of users relied on default parameters completely, so this will affect only a fraction of users of this already rarely used function.
  • Removed IsPosHoveringAnyWindow(), which was partly broken and misleading. In the vast majority of cases, people using that function wanted to use io.WantCaptureMouse flag. Replaced with IM_ASSERT + comment redirecting user to io.WantCaptureMouse. (#1237)
  • Removed the old ValueColor() helpers, they are equivalent to calling Text(label) + SameLine() + ColorButton().
  • Removed ColorEditMode() and ImGuiColorEditMode type in favor of ImGuiColorEditFlags and parameters to the various Color*() functions. The SetColorEditOptions() function allows to initialize default but the user can still change them with right-click context menu. Commenting out your old call to ColorEditMode() may just be fine!

Other Changes

  • Added flags to ColorEdit3(), ColorEdit4(). The color edit widget now has a context-menu and access to the color picker. (#346)
  • Added flags to ColorButton(). (#346)
  • Added ColorPicker3(), ColorPicker4(). The API along with those of the updated ColorEdit4() was designed so you may use them in various situation and hopefully compose your own picker if required. There are a bunch of available flags, check the Demo window and comment for ImGuiColorEditFlags_. Some of the options it supports are: two color picker types (hue bar + sat/val rectangle, hue wheel + rotating sat/val triangle), display as u8 or float, lifting 0.0..1.0 constraints (currently rgba only), context menus, alpha bar, background checkerboard options, preview tooltip, basic revert. For simple use, calling the existing ColorEdit4() function as you did before will be enough, as you can now open the color picker from there. (#346) [@r-lyeh, @nem0, @thennequin, @dariomanesku and @ocornut]
  • Added SetColorEditOptions() to set default color options (e.g. if you want HSV over RGBA, float over u8, select a default picker mode etc. at startup time without a user intervention. Note that the user can still change options with the context menu unless disabled with ImGuiColorFlags_NoOptions or explicitly enforcing a display type/picker mode etc.).
  • Added user-facing IsPopupOpen() function. (#891) [@mkeeter]
  • Added GetColorU32(u32) variant that perform the style alpha multiply without a floating-point round trip, and helps makes code more consistent when using ImDrawList APIs.
  • Added PushStyleColor(ImGuiCol idx, ImU32 col) overload.
  • Added GetStyleColorVec4(ImGuiCol idx) which is equivalent to accessing ImGui::GetStyle().Colors[idx] (aka return the raw style color without alpha alteration).
  • ImFontAtlas: Added GlyphRangesBuilder helper class, which makes it easier to build custom glyph ranges from your app/game localization data, or add into existing glyph ranges.
  • ImFontAtlas: Added TexGlyphPadding option. (#1282) [@jadwallis]
  • ImFontAtlas: Made it possible to override size of AddFontDefault() (even if it isn't really recommended!).
  • ImDrawList: Added GetClipRectMin(), GetClipRectMax() helpers.
  • Fixed Ini saving crash if the ImGuiWindowFlags_NoSavedSettings gets removed from a window after its creation (unlikely!). (#1000)
  • Fixed PushID()/PopID() from marking parent window as Accessed (which needlessly woke up the root "Debug" window when used outside of a regular window). (#747)
  • Fixed an assert when calling CloseCurrentPopup() twice in a row. [@nem0]
  • Window size can be loaded from .ini data even if ImGuiWindowFlags_NoResize flag is set. (#1048, #1056)
  • Columns: Added SetColumnWidth(). (#913) [@ggtucker]
  • Columns: Dragging a column preserve its width by default. (#913) [@ggtucker]
  • Columns: Fixed first column appearing wider than others. (#1266)
  • Columns: Fixed allocating space on the right-most side with the assumption of a vertical scrollbar. The space is only allocated when needed. (#125, #913, #893, #1138)
  • Columns: Fixed the right-most column from registering its content width to the parent window, which led to various issues when using auto-resizing window or e.g. horizonal scrolling. (#519, #125, #913)
  • Columns: Refactored some of the columns code internally toward a better API (not yet exposed) + minor optimizations. (#913) [@ggtucker, @ocornut]
  • Popups: Most popups windows can be moved by the user after appearing (if they don't have explicit positions provided by caller, or e.g. sub-menu popup). The previous restriction was totally arbitrary. (#1252)
  • Tooltip: SetTooltip() is expanded immediately into a window, honoring current font / styling setting. Add internal mechanism to override tooltips. (#862)
  • PlotHistogram: bars are drawn based on zero-line, so negative values are going under. (#828)
  • Scrolling: Fixed return values of GetScrollMaxX(), GetScrollMaxY() when both scrollbars were enabled. Tweak demo to display more data. (#1271) [@degracode]
  • Scrolling: Fixes for Vertical Scrollbar not automatically getting enabled if enabled Horizontal Scrollbar straddle the vertical limit. (#1271, #246)
  • Scrolling: SetScrollHere(), SetScrollFromPosY(): Fixed Y scroll aiming when Horizontal Scrollbar is enabled. (#665).
  • [Windows] Clipboard: Fixed not closing win32 clipboard on early open failure path. (#1264)
  • Removed an unnecessary dependency on int64_t which failed on some older compilers.
  • Demo: Rearranged everything under Widgets in a more consistent way.
  • Demo: Columns: Added Horizontal Scrolling demo. Tweaked another Columns demo. (#519, #125, #913)
  • Examples: OpenGL: Various makefiles for MINGW, Linux. (#1209, #1229, #1209) [@fr500, @acda]
  • Examples: Enabled vsync by default in example applications, so it doesn't confuse people that the sample run at 2000+ fps and waste an entire CPU. (#1213, #1151).
  • Various other small fixes, tweaks, comments, optimizations.

Gallery

See more here > #1269

Seaquence

Lumix Engine

Unnamed Engine by @antoniozero

TT Isle of Man: Ride of the Edge

StyleTransferFunction by @jose-villegas