Merge pull request #530 from sanbox-irl/prep-0.8.0

prep 0.8.0
This commit is contained in:
Jonathan Spira 2021-09-17 13:47:20 -04:00 committed by GitHub
commit f2fdfd47c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 144 additions and 105 deletions

View File

@ -1,29 +1,86 @@
# Change Log # Change Log
## [Unreleased] ## [0.8.0] - 2021-09-17
- BREAKING: MSRV is now **1.54**. This is gives us access to min-const-generics, which we use in a few places, but will gradually use more. Because this is the first time we've bumped MSRV intentionally, we have added a new feature `min-const-generics`, which is _enabled by default_. If you are pre-1.54, you can hang onto this update by disabling that feature. In our next update, this feature will be removed and we will commit to our MSRVs going forward. Welcome to the `0.8.0` update. This is one of the largest updates imgui-rs has ever seen; it will generate errors in a `0.7` project, but hopefully it should be both quick to fix, and enjoyable to update. See our [release page](https://github.com/imgui-rs/imgui-rs/releases/tag/v0.8.0) for more information and a list of contributors to this cycle. Thank you to everyone who uses `imgui-rs`, files issues, and spend their time and effort to PR new changes into the codebase. Because of all that effort, this is by far the best `imgui-rs` has looked!
- **Removed ImStr and ImString from the API.** Currently `im_str!` is deprecated and **will be removed in 0.9.0**. To change your code: - **Removed ImStr and ImString from the API.** Currently `im_str!` is deprecated and **will be removed in 0.9.0**. To change your code:
- If you were just wrapping a string literal, like `im_str!("button")`, just use `"button"`. - If you were just wrapping a string literal, like `im_str!("button")`, just use `"button"`. (Help: the regex `im_str!\("((?:(?=(\\?))\2.)*?)"\)`, replacing matches with `"$1"`, can get the majority of these quickly.);
- If you were formatting, like `&im_str!("My age is {}", 100)`, you can now just use format like `format!("My age is {}, 100)`. Notice that due to the trait bounds, you can pass the string in directly too. - If you were formatting, like `&im_str!("My age is {}", 100)`, you can now just use format like `format!("My age is {}, 100)`. Notice that due to the trait bounds, you can pass the string in directly too.
- Removed automatically adding default features for `imgui-winit-support` - BREAKING: Most tokens through the repository (eg. `WindowToken`, `TabBarToken`, `FontStackToken`, etc) now allow for permissive dropping -- i.e, you don't need to actually call the `.end()` method on them anymore. In exchange, these tokens have taken on a lifetime, which allows them to be safe. This could make some patterns impossible. Please file an issue if this causes a problem.
with the exception of the current default winit feature/dep version. Additionally, that version was updated to 0.25. If you want to not have the default features of winit with 0.25, set `default-features = false` and add `winit-25` as a normal feature. Thank you to @dzil123 for the work [implementing this here](https://github.com/imgui-rs/imgui-rs/pull/477)!
- Added an `imgui-glow-renderer` which targets `glow 0.10`. Before release, this will be updated to target current `0.11` glow when further features are added. Thank you to @jmaargh for the work [implementing this here](https://github.com/imgui-rs/imgui-rs/pull/495)! - `end()` no longer takes `Ui`. This is a breaking change, but hopefully should be trivial (and perhaps nice) for users to fix. Simply delete the argument, or add a `_` before the token's binding name and allow it to be dropped on its own. In our code, we tend to write these now like:
```rs
if let Some(_t) = ui.begin_popup("example") {
// your code here
}
```
- BREAKING: Created `with_x` variants for most functions which previously took multiple parameters where some had default arguments in the C++. This makes calling most functions simpler and more similar to the C++.
- The most likely breaking changes users will see is `button` and `same_line` now take one fewer parameter -- if you were calling `button` with `[0.0, 0.0]`, simply delete that -- otherwise, call `button_with_size`. Similarly, for `same_line`, if you were passing in `0.0.` simply delete that argument. Otherwise, call `same_line_with_pos`.
- ADDED: support for the `tables` API which was added in dear imgui `1.80`. We currently have this _feature gated_ behind `tables-api`. You should feel safe to use this in stable production, but be aware of two things:
1. The tables API is marked as "beta" meaning that it may change with fewer stability promises. This is unlikely and it seems fairly settled.
2. There are a few cases where the tables API will segfault by dereferencing a `NULL` where it should instead `ASSERT` and crash. This is simply annoying because you won't get a stacktrace. [See here for more info on that.](https://github.com/imgui-rs/imgui-rs/issues/524). If this is fixed upstream, we will issue a patch.
- ADDED: an `imgui-glow-renderer` which targets `glow 0.10`. Before release, this will be updated to target current `0.11` glow when further features are added. Thank you to @jmaargh for the work [implementing this here](https://github.com/imgui-rs/imgui-rs/pull/495)!
- UPGRADED: from v1.80 to [Dear ImGui v1.84.2](https://github.com/ocornut/imgui/releases/tag/v1.84.2) See the [Dear ImGui v1.84](https://github.com/ocornut/imgui/releases/tag/v1.84) release notes for more information. Thank you to @dbr for doing the work (twice actually) of [upgrading the repository](https://github.com/imgui-rs/imgui-rs/pull/519).
- BREAKING: Reworked how callbacks on `InputText` and `InputTextMultiline` work.
- REMOVED `.callback_name()` methods in favor of one method: `.callback(FLAGS, CallbackStruct)`.
- Wrapped callback kinds into their own enums, `InputTextCallback` and `InputTextCallbackMultiline`.
- Created a trait, `InputTextCallbackHandler`.
- To see how to create an InputText callback, see `examples/text_callback.rs`.
- Finally, please note that editing an `&mut String` which contains `\0` within it will produce _surprising_ truncation within ImGui. If you need to edit such a string, please pre-process it.
- ADDED: `begin_disable` and `begin_enable` methods. These add (finally) support for disabling _any_ widget. Thank you to @dbr for [implementing this here](https://github.com/imgui-rs/imgui-rs/pull/519).
- BREAKING: MSRV is now **1.54**. This is gives us access to min-const-generics, which we use in a few places, but will gradually use more. Because this is the first time we've bumped MSRV intentionally, we have added a new feature `min-const-generics`, which is _enabled by default_. If you are pre-1.54, you can hang onto this update by disabling that feature. In our next update, this feature will be removed and we will commit to our MSRVs going forward. Thank you to @dbr for changing our CI infrastructure to support better MSRVs [here](https://github.com/imgui-rs/imgui-rs/pull/512).
- BREAKING: Changed default version of Winit in `imgui-winit-support` to `winit 0.25`. Thank you to @repi [for implementing this here](https://github.com/imgui-rs/imgui-rs/pull/485).
- Removed automatically adding default features for `imgui-winit-support`
with the exception of the current default winit feature/dep version. If you want to not have the default features of winit with 0.25, set `default-features = false` and add `winit-25` as a normal feature. Thank you to @dzil123 for the work [implementing this here](https://github.com/imgui-rs/imgui-rs/pull/477)!
- ADDED: Support for the freetype font rasterizer. Enabled by the non-default `freetype` feature, e.g `imgui = {version = "...", features=["freetype"]})`
Thank you to @dbr for this work [implementing this here](https://github.com/imgui-rs/imgui-rs/pull/496).
- ADDED: `doc alias` support throughout the repository. You can now, [inside the docs](https://docs.rs/imgui), search for `imgui-rs` functions by their `Dear ImGui` C++ names. For example, searching for `InputText` will pull up `Ui::input_text`. This was quite a lot of documentation and effort, so thank you to @toyboot4e [for implementing this here](https://github.com/imgui-rs/imgui-rs/pull/458).
- ADDED: text hinting into `InputText`. Thank you to @lwiklendt [for implementing this here](https://github.com/imgui-rs/imgui-rs/pull/449).
- BREAKING: Reworked `.range` calls on `Slider`, `VerticalSlider`, and `Drag` to simply take two min and max values, and requires that they are provided in the constructor. - BREAKING: Reworked `.range` calls on `Slider`, `VerticalSlider`, and `Drag` to simply take two min and max values, and requires that they are provided in the constructor.
- To update without changing behavior, use the range `T::MIN` and `T::MAX` for the given numerical type (such as `i8::MIN` and `i8::MAX`). - To update without changing behavior, use the range `T::MIN` and `T::MAX` for the given numerical type (such as `i8::MIN` and `i8::MAX`).
- Using `.range` is still maintained for simplicity, but will likely be deprecated in 0.9 and removed in 0.10! - Using `.range` is still maintained for simplicity, but will likely be deprecated in 0.9 and removed in 0.10!
- BREAKING: Modifies `build` style methods to allow the provide closure to return a value. The build call will then return Some(value) if the closure is called, and None if it isn't. - `DrawListMut` has new methods to draw images
- The most likely breaking changes users will see is that they will need to add semicolons after calling `build`, because these function no longer return `()`.
- BREAKING: Created `with_x` variants for most functions which previously took multiple parameters where some had default arguments in the C++. This makes calling most functions simpler and more similar to the C++. - The methods are `add_image`, `add_image_quad`, and `add_image_rounded`. The `imgui-examples/examples/custom_textures.rs` has been updated to show their usage.
- The most likely breaking changes users will see is `button` and `same_line` now take one fewer parameter -- if you were calling `button` with `[0.0, 0.0]`, simply delete that -- otherwise, call `button_with_size`. Similarly, for `same_line`, if you were passing in `0.0.` simply delete that parameter. Otherwise, call `same_line_with_pos`. - Additionally the `imgui::draw_list` module is now public, which contains the various draw list objects. While the `add_*` methods are preferred, `imgui::draw_list::Circle::new(&draw_list_mut, ...).build()` is equivalent
- Finally, we have relaxed the limits around having multiple draw lists such that you can have multiple mutable draw lists of different kinds (ie, a `foreground` and a `background` at the same time.).
- Thank you to @dbr for [implementing these changes](https://github.com/imgui-rs/imgui-rs/pull/445).
- ADDED: the `ButtonFlags` which previously prevented `invisible_button` from being usable. Thank you to @dbr for [implementing this change here](https://github.com/imgui-rs/imgui-rs/pull/509).
- BREAKING: `PopupModal`'s `new` was reworked so that it didn't take `Ui` until `build` was called. This is a breaking change if you were invoking it directly. Simply move your `ui` call to `build` or `begin`.
- BREAKING: Restored methods to access keyboard based on backend-defined keyboard map indexes. These allow access to most keys, not just those defined in the small subset of `imgui::Keys` (note the available keys may be expanded in future by [imgui PR #2625](https://github.com/ocornut/imgui/pull/2625))
- The new methods on `imgui::Ui` are `is_key_index_down`, `is_key_index_pressed`, `is_key_index_pressed_no_repeat`, `is_key_index_released`, `is_key_index_released`
- For example `ui.is_key_released(imgui::Key::A)` is same as `ui.is_key_index_released(winit::events::VirtualKeyCode::A as i32)` when using the winit backend
- BREAKING: Modifies `build` style methods to allow the provide closure to return a value. The build call will then return Some(value) if the closure is called, and None if it isn't.
- The most likely breaking changes users will see is that they will need to add semicolons after calling `build`, because these function no longer return `()`.
- Thank you to @AngelOfSol for [implementing this here](https://github.com/imgui-rs/imgui-rs/pull/468).
- BREAKING: Removed `imgui::legacy` which contained the old style of flags. The remaining flags in `imgui::legacy` have been updated to be consistent with other flags in the project. - BREAKING: Removed `imgui::legacy` which contained the old style of flags. The remaining flags in `imgui::legacy` have been updated to be consistent with other flags in the project.
@ -32,32 +89,6 @@
- `imgui::legacy::ImGuiTreeNodeFlags` is now `imgui::widget::tree::TreeNodeFlags` - `imgui::legacy::ImGuiTreeNodeFlags` is now `imgui::widget::tree::TreeNodeFlags`
- `imgui::legacy::ImDrawListFlags` is now `imgui::draw_list::DrawListFlags` - `imgui::legacy::ImDrawListFlags` is now `imgui::draw_list::DrawListFlags`
- `DrawListMut` has new methods to draw images
- The methods are `add_image`, `add_image_quad`, and `add_image_rounded`. The `imgui-examples/examples/custom_textures.rs` has been updated to show their usage.
- Additionally the `imgui::draw_list` module is now public, which contains the various draw list objects. While the `add_*` methods are preferred, `imgui::draw_list::Circle::new(&draw_list_mut, ...).build()` is equivalent
- BREAKING: Most tokens through the repository (eg. `WindowToken`, `TabBarToken`, `FontStackToken`, etc) now allow for permissive dropping -- i.e, you don't need to actually call the `.end()` method on them anymore. In exchange, these tokens have taken on a lifetime, which allows them to be safe. This could make some patterns impossible. Please file an issue if this causes a problem.
- `end()` no longer takes `Ui`. This is a breaking change, but hopefully should be trivial (and perhaps nice) for users to fix. Simply delete the argument, or add a `_` before the token's binding name and allow it to be dropped on its own.
- BREAKING: `PopupModal`'s `new` was reworked so that it didn't take `Ui` until `build` was called. This is a breaking change if you were invoking it directly. Simply move your `ui` call to `build` or `begin`.
- Upgrade to from v1.80 to [Dear ImGui v1.82](https://github.com/ocornut/imgui/releases/tag/v1.82) (see also the [Dear ImGui v1.81](https://github.com/ocornut/imgui/releases/tag/v1.81) release notes)
- BREAKING: `imgui::ListBox::calculate_size(items_count: ..., height_in_items: ...)` has been removed as the function backing it has been marked as obsolete. The recommended approach is to calculate the size yourself and use `.size(...)` (or use the default auto-calculated size)
- BREAKING: `draw_list::CornerFlags` has been renamed to `draw_list::DrawFlags` to match the upstream change, and refle. However, the only draw flags that are useful to Rust currently are still the ones reflecting corner rounding.
- Similarly, the flag names have been updated so that `CornerFlags::$WHERE` has become `DrawFlags::ROUND_CORNERS_$WHERE`, for ecample `CornerFlags::TOP_LEFT` => `DrawFlags::ROUND_CORNERS_TOP_LEFT`.
- Importantly, `CornerFlags::NONE` became `DrawFlags::ROUND_CORNERS_NONE` (following the patter) and **not** `DrawFlags::NONE` which does exist now, and is a separate value.
- BREAKING: `InputTextFlags::ALWAYS_INSERT_MODE` is renamed to `InputTextFlags::
- However, the `always_insert_mode` funcitons on the various input builders remain as a (non-deprecated) alias, as the C++ code has kept an equivalent inline stub.
- BREAKING: `Style::circle_segment_max_error` is no more. `Style::circle_tesselation_max_error` behaves very similarly, but `circle_segment_max_error` values are not equivalent to `circle_tesselation_max_error` values.
- For example, the default `circle_segment_max_error` was 1.6, but the default `circle_tesselation_max_error` is 0.3. In practice, it's unlikely to matter much either way, though.
- Restored methods to access keyboard based on backend-defined keyboard map indexes. These allow access to most keys, not just those defined in the small subset of `imgui::Keys` (note the available keys may be expanded in future by [imgui PR #2625](https://github.com/ocornut/imgui/pull/2625))
- The new methods on `imgui::Ui` are `is_key_index_down`, `is_key_index_pressed`, `is_key_index_pressed_no_repeat`, `is_key_index_released`, `is_key_index_released`
- For example `ui.is_key_released(imgui::Key::A)` is same as `ui.is_key_index_released(winit::events::VirtualKeyCode::A as i32)` when using the winit backend
- Full (32-bit) unicode support is enabled in Dear Imgui (e.g. `-DIMGUI_USE_WCHAR32` is enabled now). Previously UTF-16 was used internally. - Full (32-bit) unicode support is enabled in Dear Imgui (e.g. `-DIMGUI_USE_WCHAR32` is enabled now). Previously UTF-16 was used internally.
- BREAKING: Some parts of the font atlas code now use `char` (or `u32`) instead of `u16` to reflect this. - BREAKING: Some parts of the font atlas code now use `char` (or `u32`) instead of `u16` to reflect this.
@ -69,8 +100,6 @@
- If you're using `DEP_IMGUI_DEFINE_`s for this already, then no change is needed. - If you're using `DEP_IMGUI_DEFINE_`s for this already, then no change is needed.
- If you're using `.cargo/config` to apply a build script override and link against a prebuilt `Dear Imgui` (or something else along these lines), you need to ensure you link with a version that was built using `-DIMGUI_USE_WCHAR32`. - If you're using `.cargo/config` to apply a build script override and link against a prebuilt `Dear Imgui` (or something else along these lines), you need to ensure you link with a version that was built using `-DIMGUI_USE_WCHAR32`.
- Support for the freetype font rasterizer. Enabled by the non-default `freetype` feature, e.g `imgui = {version = "...", features=["freetype"]})`
## [0.7.0] - 2021-02-04 ## [0.7.0] - 2021-02-04
- Upgrade to [Dear ImGui v1.80](https://github.com/ocornut/imgui/releases/tag/v1.80). (Note that the new table functionality is not yet supported, however) - Upgrade to [Dear ImGui v1.80](https://github.com/ocornut/imgui/releases/tag/v1.80). (Note that the new table functionality is not yet supported, however)
@ -706,7 +735,8 @@ As mentioned, the 0.6.1 release of `imgui-winit-support` has been yanked.
- Initial release with cimgui/imgui 1.44, glium 0.9 - Initial release with cimgui/imgui 1.44, glium 0.9
[unreleased]: https://github.com/Gekkio/imgui-rs/compare/v0.7.0...HEAD [unreleased]: https://github.com/Gekkio/imgui-rs/compare/v0.8.0...HEAD
[0.8.0]: https://github.com/Gekkio/imgui-rs/compare/v0.7.0...v0.8.0
[0.7.0]: https://github.com/Gekkio/imgui-rs/compare/v0.6.1...v0.7.0 [0.7.0]: https://github.com/Gekkio/imgui-rs/compare/v0.6.1...v0.7.0
[0.6.1]: https://github.com/Gekkio/imgui-rs/compare/v0.6.0...v0.6.1 [0.6.1]: https://github.com/Gekkio/imgui-rs/compare/v0.6.0...v0.6.1
[0.6.0]: https://github.com/Gekkio/imgui-rs/compare/v0.5.0...v0.6.0 [0.6.0]: https://github.com/Gekkio/imgui-rs/compare/v0.5.0...v0.6.0

View File

@ -175,18 +175,7 @@
END OF TERMS AND CONDITIONS END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work. Copyright {2021} the imgui-rs developers
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
Copyright (c) 2015-2020 The imgui-rs Developers Copyright (c) 2015-2021 The imgui-rs Developers
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -3,7 +3,7 @@
[![Build Status](https://github.com/imgui-rs/imgui-rs/workflows/ci/badge.svg)](https://github.com/imgui-rs/imgui-rs/actions) [![Build Status](https://github.com/imgui-rs/imgui-rs/workflows/ci/badge.svg)](https://github.com/imgui-rs/imgui-rs/actions)
[![Latest release on crates.io](https://img.shields.io/crates/v/imgui.svg)](https://crates.io/crates/imgui) [![Latest release on crates.io](https://img.shields.io/crates/v/imgui.svg)](https://crates.io/crates/imgui)
[![Documentation on docs.rs](https://docs.rs/imgui/badge.svg)](https://docs.rs/imgui) [![Documentation on docs.rs](https://docs.rs/imgui/badge.svg)](https://docs.rs/imgui)
[![Wrapped Dear ImGui Version](https://img.shields.io/badge/Dear%20ImGui%20Version-1.80-blue.svg)](https://github.com/ocornut/imgui) [![Wrapped Dear ImGui Version](https://img.shields.io/badge/Dear%20ImGui%20Version-1.84.2-blue.svg)](https://github.com/ocornut/imgui)
(Recently under new maintenance, things subject to change) (Recently under new maintenance, things subject to change)
@ -28,20 +28,24 @@ Window::new("Hello world")
## Main library crates ## Main library crates
- imgui: High-level safe API - imgui: High-level safe API
- imgui-glium-renderer: Renderer implementation that uses the `glium` crate
- imgui-gfx-renderer: Renderer implementation that uses the `gfx` crate (_not
the new gfx-hal crate_)
- imgui-winit-support: Backend platform implementation that uses the `winit` - imgui-winit-support: Backend platform implementation that uses the `winit`
crate (latest by default, but earlier versions are supported via feature flags) crate (latest by default, but earlier versions are supported via feature flags)
- imgui-glow-renderer: Renderer implementation that uses the `imgui` crate
- imgui-glium-renderer: Renderer implementation that uses the `glium` crate
- imgui-sys: Low-level unsafe API (automatically generated) - imgui-sys: Low-level unsafe API (automatically generated)
Additionally, the following are no longer maintained, but might work still:
- imgui-gfx-renderer: Renderer implementation that uses the `gfx` crate (_not
the new gfx-hal crate_)
## Features ## Features
- Bindings for Dear ImGui that can be used with safe Rust. Note: API coverage - Bindings for Dear ImGui that can be used with safe Rust. Note: API coverage
is not 100%, but will keep improving over time. is not 100%, but will keep improving over time.
- Builder structs for use cases where the original C++ library uses optional - Builder structs for use cases where the original C++ library uses optional
function parameters function parameters
- Easy integration with Glium / pre-ll gfx (renderer) - Easy integration with `glow`/ `glium`
- Easy integration with winit (backend platform) - Easy integration with winit (backend platform)
- Optional support for the freetype font rasterizer - Optional support for the freetype font rasterizer
@ -72,10 +76,10 @@ responsibilities include the following:
The most tested platform/renderer combination is `imgui-glium-renderer` + The most tested platform/renderer combination is `imgui-glium-renderer` +
`glium` + `imgui-winit-support` + `winit`, but this is not the only possible `glium` + `imgui-winit-support` + `winit`, but this is not the only possible
combination. There's also `imgui-gfx-renderer`, and you can find additional 3rd combination. There's also `imgui-glow-renderer`, which will increasingly replace
party crates that provide a wider support for more libraries (e.g. raw OpenGL, `glium`, and you can find additional 3rd party crates that provide a wider
SDL2). You can also write your own support code if you have a more advanced use support for more libraries (e.g. raw OpenGL, SDL2). You can also write your own
case, because **imgui-rs is not tied to any specific graphics / OS API**. support code if you have a more advanced use case, because **imgui-rs is not tied to any specific graphics / OS API**.
## Compiling and running the demos ## Compiling and running the demos
@ -85,7 +89,7 @@ cd imgui-rs
git submodule update --init --recursive git submodule update --init --recursive
``` ```
Main examples are located in the imgui-examples directory. Main examples are located in the `imgui-examples` directory.
```bash ```bash
# At the reposity root # At the reposity root

View File

@ -4,60 +4,69 @@ This document covers how to upgrade imgui-rs to a new version of the upstream C+
The process is much the same to build imgui-rs for a tagged release (as shown) as it is for any arbitrary revision (such as one on a different branch) The process is much the same to build imgui-rs for a tagged release (as shown) as it is for any arbitrary revision (such as one on a different branch)
## Step by step ## Step by step
1. Ensure the submodules are populated (`git submodule init` and `git submodule update --recursive`) 1. Ensure the submodules are populated (`git submodule init` and `git submodule update --recursive`)
2. Check out the desired version of the `imgui-sys/third-party/imgui/` submodule 2. Check out the desired version of the `imgui-sys/third-party/imgui/` submodule
$ pwd ```sh
.../imgui-sys/third-party/imgui $ pwd
$ git checkout v1.81 .../imgui-sys/third-party/imgui
Previous HEAD position was 58075c44 Version 1.80 $ git checkout v1.81
HEAD is now at 4df57136 Version 1.81 Previous HEAD position was 58075c44 Version 1.80
HEAD is now at 4df57136 Version 1.81
```
3. Ensure `luajit` is installed, as this is required by cimgui's generator. 3. Ensure `luajit` is installed, as this is required by cimgui's generator.
$ luajit --help $ luajit --help
4. Check out the `cimgui` project somewhere, as we use use the generator within this 4. Check out the `cimgui` project somewhere, as we use use the generator within this
$ git clone --recursive https://github.com/cimgui/cimgui.git /tmp/cimgui ```sh
git clone --recursive https://github.com/cimgui/cimgui.git /tmp/cimgui
```
5. Ensure the `imgui` submodule within `cimgui` is pointing to the same revision as in `imgui-rs` 5. Ensure the `imgui` submodule within `cimgui` is pointing to the same revision as in `imgui-rs`
$ cd /tmp/cimgui/imgui ```sh
$ git checkout v1.81 $ cd /tmp/cimgui/imgui
HEAD is now at 4df57136 Version 1.81 $ git checkout v1.81
HEAD is now at 4df57136 Version 1.81
```
6. Back in `imgui-rs/imgui-sys/third-party/` - run the `update-cimgui-output.sh` helper script to execute cimgui's generator 6. Back in `imgui-rs/imgui-sys/third-party/` - run the `update-cimgui-output.sh` helper script to execute cimgui's generator
$ pwd ```sh
.../imgui-sys/third-party $ pwd
$ ./update-cimgui-output.sh /tmp/cimgui/ .../imgui-sys/third-party
[...] $ ./update-cimgui-output.sh /tmp/cimgui/
copyfile ./output/cimgui.h ../cimgui.h [...]
copyfile ./output/cimgui.cpp ../cimgui.cpp copyfile ./output/cimgui.h ../cimgui.h
all done!! copyfile ./output/cimgui.cpp ../cimgui.cpp
all done!!
```
This updates various files in the imgui-sys folder like `cimgui.cpp`, `definitions.json` and so on This updates various files in the imgui-sys folder like `cimgui.cpp`, `definitions.json` and so on
With this step, we now have new C bindings to the desired verison of Dear ImGui. With this step, we now have new C bindings to the desired verison of Dear ImGui.
7. Back in the root of the imgui-rs repo, run `cargo xtask bindgen` 7. Back in the root of the imgui-rs repo, run `cargo xtask bindgen`
$ cargo xtask bindgen ```sh
$ cargo xtask bindgen
Finished dev [unoptimized + debuginfo] target(s) in 0.04s Finished dev [unoptimized + debuginfo] target(s) in 0.04s
Running `target/debug/xtask bindgen` Running `target/debug/xtask bindgen`
Executing bindgen [output = .../imgui-rs/imgui-sys/src/bindings.rs] Executing bindgen [output = .../imgui-rs/imgui-sys/src/bindings.rs]
Success [output = .../imgui-rs/imgui-sys/src/bindings.rs] Success [output = .../imgui-rs/imgui-sys/src/bindings.rs]
Executing bindgen [output = .../imgui-rs/imgui-sys/src/wasm_bindings.rs] Executing bindgen [output = .../imgui-rs/imgui-sys/src/wasm_bindings.rs]
Success [output = .../imgui-rs/imgui-sys/src/wasm_bindings.rs] Success [output = .../imgui-rs/imgui-sys/src/wasm_bindings.rs]
```
This requires bindgen to be installed (`cargo install bindgen` should do it) This requires bindgen to be installed (`cargo install bindgen` should do it)
This step generates `imgui-sys/src/bindings.rs` which is used by `imgui/src/*` This step generates `imgui-sys/src/bindings.rs` which is used by `imgui/src/*`
8. Run `cargo build` and fix any errors caused by changes upstream (see next section) 8. Run `cargo build` and fix any errors caused by changes upstream (see next section)
@ -65,8 +74,9 @@ The process is much the same to build imgui-rs for a tagged release (as shown) a
10. Try running one of the examples 10. Try running one of the examples
cargo run --example test_window_impl ```sh
cargo run --example test_window_impl
```
## Common sources of problems ## Common sources of problems

View File

@ -9,6 +9,9 @@ repository = "https://github.com/imgui-rs/imgui-rs"
license = "MIT/Apache-2.0" license = "MIT/Apache-2.0"
publish = false publish = false
[badges]
maintenance = { status = "deprecated" }
[features] [features]
opengl = ["imgui-gfx-renderer/opengl"] opengl = ["imgui-gfx-renderer/opengl"]
# FIXME # FIXME

View File

@ -1,6 +1,6 @@
[package] [package]
name = "imgui-gfx-renderer" name = "imgui-gfx-renderer"
version = "0.7.0" version = "0.8.0"
edition = "2018" edition = "2018"
authors = ["The imgui-rs Developers"] authors = ["The imgui-rs Developers"]
description = "gfx renderer for the imgui crate" description = "gfx renderer for the imgui crate"
@ -14,9 +14,12 @@ opengl = []
directx = [] directx = []
default = ["opengl"] default = ["opengl"]
[badges]
maintenance = { status = "deprecated" }
[dependencies] [dependencies]
gfx = "0.18" gfx = "0.18"
imgui = { version = "0.7.0", path = "../imgui" } imgui = { version = "0.8.0", path = "../imgui" }
[target.'cfg(windows)'.build-dependencies] [target.'cfg(windows)'.build-dependencies]
winapi = { version = "0.3", features = ["d3dcompiler"] } winapi = { version = "0.3", features = ["d3dcompiler"] }

View File

@ -1,6 +1,6 @@
[package] [package]
name = "imgui-glium-renderer" name = "imgui-glium-renderer"
version = "0.7.0" version = "0.8.0"
edition = "2018" edition = "2018"
authors = ["The imgui-rs Developers"] authors = ["The imgui-rs Developers"]
description = "Glium renderer for the imgui crate" description = "Glium renderer for the imgui crate"
@ -11,4 +11,4 @@ categories = ["gui", "rendering"]
[dependencies] [dependencies]
glium = { version = ">=0.28, < 0.31", default-features = false } glium = { version = ">=0.28, < 0.31", default-features = false }
imgui = { version = "0.7.0", path = "../imgui" } imgui = { version = "0.8.0", path = "../imgui" }

View File

@ -1,8 +1,8 @@
[package] [package]
name = "imgui-glow-renderer" name = "imgui-glow-renderer"
version = "0.7.0" version = "0.8.0"
edition = "2018" edition = "2018"
authors = ["The imgui-rs Developers"] authors = ["jmaargh and the imgui-rs Developers"]
description = "glow renderer for the imgui crate" description = "glow renderer for the imgui crate"
homepage = "https://github.com/imgui-rs/imgui-rs" homepage = "https://github.com/imgui-rs/imgui-rs"
repository = "https://github.com/imgui-rs/imgui-rs" repository = "https://github.com/imgui-rs/imgui-rs"
@ -10,13 +10,13 @@ license = "MIT/Apache-2.0"
categories = ["gui", "rendering"] categories = ["gui", "rendering"]
[dependencies] [dependencies]
imgui = { version = "0.7.0", path = "../imgui" } imgui = { version = "0.8.0", path = "../imgui" }
glow = "0.10.0" glow = "0.10.0"
memoffset = "0.6.4" memoffset = "0.6.4"
[dev-dependencies] [dev-dependencies]
glutin = "0.27.0" glutin = "0.27.0"
imgui-winit-support = { version = "0.7.1", path = "../imgui-winit-support" } imgui-winit-support = { version = "0.8.0", path = "../imgui-winit-support" }
image = "0.23" image = "0.23"
[features] [features]

View File

@ -1,6 +1,6 @@
[package] [package]
name = "imgui-sys" name = "imgui-sys"
version = "0.7.0" version = "0.8.0"
edition = "2018" edition = "2018"
authors = ["The imgui-rs Developers"] authors = ["The imgui-rs Developers"]
description = "Raw FFI bindings to dear imgui" description = "Raw FFI bindings to dear imgui"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "imgui-winit-support" name = "imgui-winit-support"
version = "0.7.1" version = "0.8.0"
edition = "2018" edition = "2018"
authors = ["The imgui-rs Developers"] authors = ["The imgui-rs Developers"]
description = "winit support code for the imgui crate" description = "winit support code for the imgui crate"
@ -10,7 +10,7 @@ license = "MIT/Apache-2.0"
categories = ["gui"] categories = ["gui"]
[dependencies] [dependencies]
imgui = { version = "0.7.0", path = "../imgui" } imgui = { version = "0.8.0", path = "../imgui" }
winit-19 = { version = ">= 0.16, < 0.20", package = "winit", optional = true } winit-19 = { version = ">= 0.16, < 0.20", package = "winit", optional = true }
winit-20 = { version = ">= 0.20, < 0.22", package = "winit", optional = true } winit-20 = { version = ">= 0.20, < 0.22", package = "winit", optional = true }
winit-22 = { version = "0.22", package = "winit", optional = true } winit-22 = { version = "0.22", package = "winit", optional = true }

View File

@ -1,6 +1,6 @@
[package] [package]
name = "imgui" name = "imgui"
version = "0.7.0" version = "0.8.0"
edition = "2018" edition = "2018"
authors = ["The imgui-rs Developers"] authors = ["The imgui-rs Developers"]
description = "High-level Rust bindings to dear imgui" description = "High-level Rust bindings to dear imgui"
@ -14,7 +14,7 @@ exclude = ["/resources"]
[dependencies] [dependencies]
bitflags = "1" bitflags = "1"
imgui-sys = { version = "0.7.0", path = "../imgui-sys" } imgui-sys = { version = "0.8.0", path = "../imgui-sys" }
parking_lot = "0.11" parking_lot = "0.11"
[features] [features]