Commit Graph

95 Commits

Author SHA1 Message Date
Emil Ernerfeldt 00ac5b2015 Add clippy lint `match_bool` 2024-06-18 23:45:25 +02:00
Emil Ernerfeldt 814ad0783c
Update to wgpu 0.20 (#4560)
* this PR reverts https://github.com/emilk/egui/pull/4559
* and re-applies https://github.com/emilk/egui/pull/4433

Before we merge, we're waiting for a wgpu 0.20.1 patch-release of

* https://github.com/gfx-rs/wgpu/pull/5681

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2024-06-13 15:00:23 +02:00
Emil Ernerfeldt 54429e0549
Revert update to wgpu 0.20 => downgrade to wgpu 0.19.1 (#4559)
0.20 has a bunch of bugs that will be fixed by:

* https://github.com/gfx-rs/wgpu/pull/5681

At Rerun, we don't want to wait for the wgpu 0.20.1 patch release before
we update egui, so we will temporarily downgrade to wgpu 0.19

After reverting I'll open a new PR that will update to 0.20 again, with
the intention of merging that once 0.20.1 is released.
2024-05-28 14:40:43 +02:00
Emil Ernerfeldt a8b50e6aa1
Move test crates to own folder (#4554) 2024-05-27 21:28:33 +02:00
hellodword 8321f64f6e
Update ahash 0.8.6 -> 0.8.11 (#4507)
See:
https://github.com/tkaitchuck/aHash/pull/183#issuecomment-1789806373

* Closes https://github.com/emilk/egui/issues/4476
2024-05-20 17:31:17 +02:00
Emil Ernerfeldt 738ea75453 Add clippy::use_self lint 2024-05-16 17:28:37 +02:00
Oscar Gustafsson c1eb3f884d
Move dependencies to workspace (#4495)
<!--
Please read the "Making a PR" section of
[`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/master/CONTRIBUTING.md)
before opening a Pull Request!

* Keep your PR:s small and focused.
* The PR title is what ends up in the changelog, so make it descriptive!
* If applicable, add a screenshot or gif.
* If it is a non-trivial addition, consider adding a demo for it to
`egui_demo_lib`, or a new example.
* Do NOT open PR:s from your `master` branch, as that makes it hard for
maintainers to add commits to your PR.
* Remember to run `cargo fmt` and `cargo clippy`.
* Open the PR as a draft until you have self-reviewed it and run
`./scripts/check.sh`.
* When you have addressed a PR comment, mark it as resolved.

Please be patient! I will review your PR, but my time is limited!
-->

Inspired by:

44d65f41ac/Cargo.toml (L65)

I took the liberty of removing that comment since I *think* that I got
all "relevant" ones (showing up more than once, sort of).
2024-05-14 11:02:49 +02:00
Emil Ernerfeldt 44d65f41ac
Update `image` crate to 0.25 (#4160)
To not produce duplicating deps in Rerun
(https://github.com/rerun-io/rerun/pull/5280) I suggest we wait with
merging this until these crates have updated to `image` 0.25:
* [x] [`arboard`](https://crates.io/crates/arboard)
* [x] [`gltf`](https://crates.io/crates/gltf)
2024-05-13 13:35:15 +02:00
Simon Niedermayr c9b24d5a5c
Update to wgpu 0.20 (#4433)
updates the wgpu version to 0.20 and changes the API calls accordingly. 
I had to update wasm-bindgen to "0.2.92". Otherwise, I got this error
for the demo app:
```
error: failed to select a version for `wasm-bindgen`.
    ... required by package `js-sys v0.3.69`
    ... which satisfies dependency `js-sys = "^0.3.69"` of package `eframe v0.27.2 (/home/user/Projects/egui/crates/eframe)`
    ... which satisfies path dependency `eframe` (locked to 0.27.2) of package `confirm_exit v0.1.0 (/home/user/Projects/egui/examples/confirm_exit)`
versions that meet the requirements `^0.2.92` are: 0.2.92

all possible versions conflict with previously selected packages.

  previously selected package `wasm-bindgen v0.2.90`
    ... which satisfies dependency `wasm-bindgen = "=0.2.90"` of package `egui_demo_app v0.27.2 (/home/user/Projects/egui/crates/egui_demo_app)`

failed to select a version for `wasm-bindgen` which could resolve this conflict
```

Why is it locked to this version right now?

I ran the tests, checked the web demo and my own projects, and
everything seems to work fine with wgpu 0.20.

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2024-04-30 11:47:12 +02:00
YgorSouza 0bc59f578b
Fix some typos from the cranky-clippy transition (#4417) 2024-04-26 07:46:25 +02:00
Emil Ernerfeldt 2f508d6a61
Replace cargo-cranky with workspace lints (#4413)
Replace `cargo-cranky` (which has served us well) with workspace lints
2024-04-25 17:24:50 +02:00
Emil Ernerfeldt cee790681d
Update to Rust 1.76 (#4411)
Motivation: I want to replace `cargo-cranky` with workspace lints, first
available in Rust 1.74.
However, `cargo doc` would hange on `wgpu` and `wgpu-core` on 1.74 and
1.75… so now we're on 1.76.
I think this is fine - when 1.78 is released next week we're still two
versions behind the bleeding edge.

…and the branch name is just wrong 🤦
2024-04-25 15:51:01 +02:00
YgorSouza 46b241eb94
Add `xtask` crate (#4293)
Replaces only the cargo_deny.sh script for now. Can be expanded over
time to replace the other shell and python scripts, so only Rust is
needed to work with the repository.

Closes <https://github.com/emilk/egui/issues/2887>
Closes <https://github.com/emilk/egui/issues/4373>

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-04-21 19:26:16 +02:00
Emil Ernerfeldt 15b0ef3259 Release 0.27.2 - Fix blurry web rendering 2024-04-02 18:18:43 +02:00
Emil Ernerfeldt dfbe118ea4
Release 0.27.1 (#4264)
## egui changelog
### 🐛 Fixed
* Fix visual glitch on the right side of highly rounded rectangles
[#4244](https://github.com/emilk/egui/pull/4244)
* Prevent visual glitch when shadow blur width is very high
[#4245](https://github.com/emilk/egui/pull/4245)
* Fix `InputState::any_touches` and add `InputState::has_touch_screen`
[#4247](https://github.com/emilk/egui/pull/4247)
* Fix `Context::repaint_causes` returning no causes
[#4248](https://github.com/emilk/egui/pull/4248)
* Fix touch-and-hold to open context menu
[#4249](https://github.com/emilk/egui/pull/4249)
* Hide shortcut text on zoom buttons if `zoom_with_keyboard` is false
[#4262](https://github.com/emilk/egui/pull/4262)

### 🔧 Changed
* Don't apply a clip rect to the contents of an `Area` or `Window`
[#4258](https://github.com/emilk/egui/pull/4258)


## eframe changelog
* Web: repaint if the `#hash` in the URL changes
[#4261](https://github.com/emilk/egui/pull/4261)
* Add web support for `zoom_factor`
[#4260](https://github.com/emilk/egui/pull/4260) (thanks
[@justusdieckmann](https://github.com/justusdieckmann)!)

---------

Co-authored-by: Justus Dieckmann <45795270+justusdieckmann@users.noreply.github.com>
2024-03-29 13:12:26 +01:00
Emil Ernerfeldt 4d4cb3d20d Release 0.27.0 - Nicer menus and new hit test logic 2024-03-26 17:13:57 +01:00
Emil Ernerfeldt 3672b150ed Release 0.26.2 - Response.interact/context_menu fix 2024-02-14 10:49:57 +01:00
Emil Ernerfeldt d22ee81ab0 Release 0.26.1 - Bug Fixes 2024-02-11 09:03:09 +01:00
Emil Ernerfeldt 410957870b
Update to document-features 0.2.8 (#4003)
Solves a build issue: https://github.com/rerun-io/rerun/issues/5113
2024-02-10 09:13:25 +01:00
Emil Ernerfeldt 56bf8b79f3 Release 0.26.0 - Text selection in labels 2024-02-05 17:28:10 +01:00
Emil Ernerfeldt d02491425c
Put all egui crates as workspace crates (#3976)
Second attempty
2024-02-05 12:59:49 +01:00
Emil Ernerfeldt bcebfecb84
Use more workspace dependencies (#3975) 2024-02-05 12:43:58 +01:00
Emil Ernerfeldt 8f2c8664e7
Emilk/revert workspace deps (#3942)
* Closes https://github.com/emilk/egui/issues/3941

Workspace dependencies can be annoying.

If you don't set them to `default-features=false`, then you cannot opt
out of their default features anywhere else, and get warnings if you
try.

So you set `default-features=false`, and then you need to manually opt
in to the default features everywhere else.
Or, as in my case, don't.

I don't have the energy to do this tonight, so I'll just revert.
2024-02-01 21:29:48 +01:00
Emil Ernerfeldt 00cd671ad8 Use workspace dependencies for the egui crates 2024-02-01 20:25:31 +01:00
Emil Ernerfeldt 948db61a8a
Update to puffin 0.19 (#3940)
…and some other smaller crate updates
2024-02-01 20:15:11 +01:00
Emil Ernerfeldt 21253d844e
Postpone call to get_current_texture (#3914)
This should help slightly with CPU/GPU parallelism when vsync is on.

I also return the time spent on vsync, which can help users figure out
how much CPU wall-time was used on non-vsync stuff
2024-01-29 18:06:21 +01:00
Emil Ernerfeldt 3a8e2348a5
`egui-wgpu`: turn off the default features of `wgpu` (#3875)
This makes all `wgpu` features opt-in for `egui-wgpu` users.

For `eframe`, I opted to enable some `wgpu` features so users can still
use `eframe` without having to also opt-in to extra ewgpu features
(eframe is batteries-included).
2024-01-24 09:43:40 +01:00
Emil Ernerfeldt 4d1a736016
Add `WgpuConfiguration::desired_maximum_frame_latency` (#3874)
Setting `desired_maximum_frame_latency` to a low value should
theoretically lead to lower latency in winit apps using `egui-wgpu`
(e.g. in `eframe` with `wgpu` backend).

* Replaces https://github.com/emilk/egui/pull/3714
* See also https://github.com/gfx-rs/wgpu/pull/4899

----

It seems like `desired_maximum_frame_latency` has no effect on my Mac. I
lowered my monitor refresh-rate to 30Hz to test, and can see no
difference between `desired_maximum_frame_latency` of `0` or `3`.

Before when experimenting with changing the global `DESIRED_NUM_FRAMES`
in `wgpu` I saw a huge difference, so I wonder what has changed.

I verified that `set_maximum_drawable_count` is being called with either
`1` or `2`, but I perceive no difference between the two.
2024-01-24 09:36:17 +01:00
Emil Ernerfeldt b766a48fa7
Update wgpu to 0.19 (#3824)
* Closes https://github.com/emilk/egui/issues/3675

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
Co-authored-by: Mingun <Alexander_Sergey@mail.ru>
2024-01-19 10:14:13 +01:00
Emil Ernerfeldt 12ad9e7b36 Release 0.25.0 - Better keyboard input 2024-01-08 12:25:43 +01:00
Emil Ernerfeldt 449678e617
Update to glow 0.13 (#3715) 2023-12-18 15:15:20 +01:00
Emil Ernerfeldt c8dd3dd01a
Update dependencies (#3700)
Also disable `regex` `env_logger` feature in examples to improve compile
times.
2023-12-12 12:59:40 +01:00
Emil Ernerfeldt b1721a3ce7
Release `egui_extras` 0.24.2 - Fix `Table` scrolling bug (#3691)
Includes:
* https://github.com/emilk/egui/pull/3690

---------

Co-authored-by: Antoine Beyeler <49431240+abey79@users.noreply.github.com>
2023-12-08 10:32:06 +01:00
Emil Ernerfeldt d17613c242 Release 0.24.1 - Bug fixes 2023-11-30 17:46:25 +01:00
Emil Ernerfeldt be1f6cd699 Use `panic = "abort"` for slightly faster compilation 2023-11-30 17:28:33 +01:00
Emil Ernerfeldt bd087ffb8d Release 0.24.0 - Multi-viewport 2023-11-23 15:56:46 +01:00
Emil Ernerfeldt 96bc34a66d Use workspace definitions of edition,license,rust-version,version 2023-11-23 15:45:11 +01:00
Emil Ernerfeldt 1bbd5a9fc8
Update puffin to 0.18 (#3600)
THe profiling macros now contain unsafe code (but in a safe way), so
`#[foribd(unsafe)]` had to become `#[deny(unsafe)]`
2023-11-21 17:58:33 +01:00
Emil Ernerfeldt bfadb90d42
Update MSRV to Rust 1.72 (#3595)
Required to update to puffin 0.18
2023-11-21 17:26:35 +01:00
Emil Ernerfeldt e823491240
Update some crate dependencies (#3594)
Nothing major
2023-11-21 16:07:56 +01:00
Emil Ernerfeldt 7bfaf49636
Update to puffin 0.17 (#3581) 2023-11-19 21:28:42 +01:00
Andreas Reich cd46691423
Updated to latest wgpu (0.18.0) (#3505)
Tested on M1 Mac:
* native
* webgl, firefox
* webgpu, chrome

all looking normal


Updated minor ahash version because 0.8.1 got yanked. Added some deny
exceptions for now - we'll have to update winit soon to resolve glow
related cargo deny errors (not a big issue though since we don't expect
wgpu and glow backends to be used at the same time)
2023-11-11 21:58:32 +01:00
Emil Ernerfeldt 7b169ec13d
Break out plotting to own crate `egui_plot` (#3282)
This replaces `egui::plot` with the new crate `egui_plot`
2023-08-27 17:22:49 +02:00
Andreas Reich b896d641c5
Improved wgpu callbacks (#3253)
* Improved wgpu callbacks

* update documentation on egui_wgpu callbacks

* make shared callback resource map pub

* make it nicer to create epaint::PaintCallback from egui_wgpu callback

* constrain ClippedPrimitive lifetime to outlive wgpu::RenderPass

* Revert callback resources to TypeMap, put finish_prepare on callback trait

* doc string fixes
2023-08-15 17:17:39 +02:00
Aaron Hill 98087029e0
Update to `wgpu` 0.17.0 (#3170)
* Bump `wgpu` to 0.17.0
This required bumping wasm-bindgen to 0.2.87
* cargo deny exception for `foreign-types`
* sort deny.toml
* Add fragile-send-sync-non-atomic-wasm feature to wgpu
* cargo deny: ignore children of foreign-types

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-08-11 17:10:10 +02:00
Andreas Reich f76eefb98d
[wgpu] Expose wgpu::Adapter via RenderState (#2954)
* [wgpu] Expose adapter, better errors, better docs, more code sharing, use stencil bits

* doc fix

* remove unnecessary unsafe

* handle missing framebuffer format

* better handling of renderstate creation in winit.rs

* remove unnecessary use directive
2023-04-25 17:42:13 +02:00
Emil Ernerfeldt 4809747952
Check for typos on CI (#2918)
* Check for typos on CI

* Fix all typos
2023-04-18 16:10:20 +02:00
Emil Ernerfeldt 1353a5733f
Deprecate `egui_glium` - looking for new maintainer (#2668)
* Deprecate egui_glium - looking for new maintainer

egui_glium was the first backend of egui, and it served us well for
a long time, but we have long since moved on to glow and wgpu.

Not egui_glium is holding back an update to latest winit.

Since development on glium has long since been discontinued I will
therefore deprecate egui_glium with this PR.

The code is still there in the repository for a while longer,
but is no longer compiled.

If there is any interest in maintaining egui_glium, then fork it and
make a PR to remove the last egui_glium from this repository.
I will give you publish rights on crates.io.

* update glutin 0.30.2 -> 0.30.3

* cargo update -p backtrace

    Updating crates.io index
    Updating addr2line v0.17.0 -> v0.19.0
    Updating backtrace v0.3.66 -> v0.3.67
    Updating gimli v0.26.2 -> v0.27.1
    Removing miniz_oxide v0.5.4
    Updating object v0.29.0 -> v0.30.3

* cargo deny: allow duplicates of windows-sys, wayland-sys, and nix

* cargo-deny whitelist tiny-skia
2023-02-04 11:21:02 +01:00
John Hughes 8c59888ebd
Add simple Windows CI workflow check (#2663)
* Add simple Windows CI workflow check

* Fix Windows build in CI

* Windows fix
2023-02-03 13:19:12 +01:00
Andreas Reich 5effc68ba4
Split out ecolor crate (#2399)
* split out ecolor crate

* split up ecolor crate in lots of modules

* add changelog notes

* add readme to ecolor

* put clippy::manual_range_contains on cranky allow list

* fix hex color issues

* doc fixes

* more hex_color fixes

* Document features

* Rename hex_color module to avoid warning

* Sort the feature names

* fix link in CHANGELOG.md

* better wording

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-12-06 20:42:25 +01:00