Skip to content

v0.7.0

Compare
Choose a tag to compare
@thomcc thomcc released this 05 Feb 05:09

v0.7.0

  • Upgrade to Dear ImGui v1.80. (Note that the new table functionality is not yet supported, however)

  • Ui::key_index() is now called internally when needed, and the various is_key_foo now take a Key directly: #416

    • is_key_down, is_key_pressed, is_key_released and key_pressed_amount now take a Key instead of u32 (breaking).
    • key_index is no longer public (breaking). If you need access to the key map, it can be accessed as ui.io().key_map[key] (If you need to do this, file a bug, since I'm open to exposing this if there's actually a use case).
  • winit 0.23/0.24 handling has been (hopefully) fixed: #420 (breaking, see also #412).

    • imgui-winit-support's winit-23 feature no longer supports winit version 0.24 (this caused an unintentional semver breakage in the imgui-winit-support crate before, unfortunately).
    • imgui-winit-support has a new winit-24 feature for 0.24 support.
    • By default imgui-winit-support feature now enables winit-24, and not winit-23 (by default it will always enable the latest).
  • The imgui crate no longer depends on gfx or glium directly: #420 (breaking, related to the previous change).

    • That is, the gfx and glium features are removed to reduce version compatibility issues going forward.
      • This only matters if you manually implement gfx or glium renderers without using the imgui-glium-renderer or imgui-gfx-renderer crates.
      • In the (somewhat unlikely) case you were relying on these this, you should define your own vertex type that's layout-compatible with imgui::DrawVert, and replace calls to imgui::DrawList::vtx_buffer() with imgui::DrawList::transmute_vtx_buffer::<MyDrawVert>(). You can see imgui_glium_renderer::GliumDrawVert and imgui_gfx_renderer::GfxDrawVert types respectively for examples of this, if needed, but it should be straightforward enough if you're already implementing a renderer from scratch.
    • This is admittedly less convenient, but avoids depending on any specific version of gfx or glium in the core imgui crate, which will ease maintenance and reduce unintentional breakage in the future.
  • Non-window DrawList support has been fixed/improved: #414

    • WindowDrawList has been renamed to DrawListMut, to reflect that it may refer to other kinds of draw lists, and is mutable, unlike imgui::DrawList (breaking).
    • Ui::get_background_draw_list() has been fixed when used outside of a window context, and now has an example.
    • Ui::get_foreground_draw_list() has been added, analogous to Ui::get_background_draw_list().
  • Added drag drop support, with a safe and an unsafe variant: #428

    • DragDropSource allows users to create a dragdrop payload which is either empty, of 'static + Copy data,
      or unsafe, allowing for theoretically arbitrary payloads.
    • DragDropTarget allows users to accept any of the above payloads.
    • Extensive documentation has been made on all of these features, hopefully as a target for future features.
  • ImColor (which is a wrapper around u32) has been renamed to ImColor32 in order to avoid confusion with the ImColor type from the Dear ImGui C++ code (which is a wrapper around ImVec4). In the future an ImColor type which maps more closely to the C++ one will be added.

    • Additionally, a number of constructor and accessor methods have been added to it ImColor, which are const fn where possible.
  • The im_str! macro can now be used in const contexts (when the format! version is not used).

  • im_str! now verifies that the parameter has no interior nuls at compile time. This can be avoided to get the old (truncating) behavior by forcing it to use the format!-like version, e.g. im_str!("for_some_reason_this_should_be_truncated\0 there {}", "").

    • This is not recommended, and is probably not useful.
  • Many functions are now const fn.

  • A large number of small functions are now #[inline], but many still aren't, so you probably will want to build with LTO for release builds if you use imgui heavily.

  • The io.config_windows_memory_compact_timer flag has been renamed to io.config_memory_compact_timer. This follows the similar rename in the C++ ImGui, and was done because it no longer only applies to window memory usage.

  • The variants of ColorEditInputMode and ColorEditDisplayMode have been renamed to be CamelCase instead of upper case (e.g. ColorEditFooMode::RGB => ColorEditFooMode::Rgb).

    • However, this change is probably not breaking (in practice if not in theory) because const aliases using the old names are provided.