Commit Graph

184 Commits

Author SHA1 Message Date
lucasmerlin 40bf21728d
Move gifs to git lfs (#5706)
Since we moved pngs to lfs I think we should also move the gifs there.

* [x] I have followed the instructions in the PR template
2025-03-03 15:51:43 +01:00
Emil Ernerfeldt 10523ec22d Improve README.md slightly 2025-01-29 08:44:29 +01:00
Pol Welter 35860418ac
Use bitfield instead of bools in `Response` and `Sense` (#5556)
<!--
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 test and 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!
-->

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

Factoring the `bool` members of `Response` into a bitfield, the size of
`Response` is now 96 bytes (down from 104).

I gave `Sense` the same treatment, however this has no effects on
`Response` due to padding. I've decided not to pursue `PointerState`, as
it is quite large (_many_ members that are sized and aligned to
multiples of 8 bytes), so I don't expect any noticeable benefit from
making handful of `bool`s slightly leaner.

In any case, the changes to `Sense` are already quite a bit more
intrusive than those to `Response`.
The previous implementation overloaded the names of the attributes
`click` and `drag` with similarly named methods that _construct_ `Sense`
with the corresponding flag set. Now, that the attributes can no longer
be accessed directly, I had to introduce methods with new names
(`senses_click()`, `senses_drag()` and `is_focusable()`). I don't think
this is the cleanest solution: the old methods are essentially redundant
now that the named constants like `Sense::CLICK` exist. I did however
not want to needlessly break backwards compatibility.
I am happy to revert it (or go further 🙂) if there are concerns.
2025-01-06 19:29:53 +01:00
lucasmerlin 2f9b14def8
Add links to the wiki and move integrations there (#5373)
* [x] I have followed the instructions in the PR template
2024-11-26 15:00:38 +01:00
Elie Michel 83a30064f4
Minor typo in README (#5381) 2024-11-18 17:28:22 +01:00
Ilya Zlobintsev 00cb50ebad
Add `gtk-egui-area` integration to README (#5129)
<!--
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 test and 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!
-->
* [x] I have followed the instructions in the PR template

Hi, I've made an integration that allows egui to be embedded as a widget
inside of a GTK application. I'm planning to use it to draw interactive
plots via `egui_plot`, as I haven't found comparable plotting widgets in
GTK. I hope others will find this integration useful as well.

The library doesn't do its own rendering, it instead relies on
`egui_glow` to render inside of a GTK-provided OpenGL drawing area.

It is published on [crates.io](https://crates.io/crates/gtk-egui-area).
2024-09-19 13:30:43 +02:00
Emil Ernerfeldt 66076101e1
Add `Context::request_discard` (#5059)
* Closes https://github.com/emilk/egui/issues/4976
* Part of #4378 
* Implements parts of #843

### Background
Some widgets (like `Grid` and `Table`) needs to know the width of future
elements in order to properly size themselves. For instance, the width
of the first column of a grid may not be known until all rows of the
grid has been added, at which point it is too late. Therefore these
widgets store sizes from the previous frame. This leads to "first-frame
jitter", were the content is placed in the wrong place for one frame,
before being accurately laid out in subsequent frames.

### What
This PR adds the function `ctx.request_discard` which discards the
visual output and does another _pass_, i.e. calls the whole app UI code
once again (in eframe this means calling `App::update` again). This will
thus discard the shapes produced by the wrongly placed widgets, and
replace it with new shapes. Note that only the visual output is
discarded - all other output events are accumulated.

Calling `ctx.request_discard` should only be done in very rare
circumstances, e.g. when a `Grid` is first shown. Calling it every frame
will mean the UI code will become unnecessarily slow.

Two safe-guards are in place:

* `Options::max_passes` is by default 2, meaning egui will never do more
than 2 passes even if `request_discard` is called on every pass
* If multiple passes is done for multiple frames in a row, a warning
will be printed on the screen in debug builds:


![image](https://github.com/user-attachments/assets/c2c1e4a4-b7c9-4d7a-b3ad-abdd74bf449f)

### Breaking changes
A bunch of things that had "frame" in the name now has "pass" in them
instead:

* Functions called `begin_frame` and `end_frame` are now called
`begin_pass` and `end_pass`
* `FrameState` is now `PassState`
* etc


### TODO
* [x] Figure out good names for everything (`ctx.request_discard`)
* [x] Add API to query if we're gonna repeat this frame (to early-out
from expensive rendering)
* [x] Clear up naming confusion (pass vs frame) e.g. for `FrameState`
* [x] Figure out when to call this
* [x] Show warning on screen when there are several frames in a row with
multiple passes
* [x] Document
* [x] Default on or off?
* [x] Change `Context::frame_nr` name/docs
* [x] Rename `Context::begin_frame/end_frame` and deprecate the old ones
* [x] Test with Rerun
* [x] Document breaking changes
2024-09-13 14:20:51 +02:00
trevyn 7b3752fde9
Update README to maintained Tetra integration (#4606)
Original integration https://github.com/tesselode/egui-tetra is
archived, so I forked and updated for latest `egui` and `tetra`.
2024-06-03 10:21:40 +02:00
Emil Ernerfeldt 6b607ffa2a Remove unmaintained `amethyst_egui` from README.md 2024-05-16 13:33:07 +02:00
Emil Ernerfeldt 79fbd17b33
Add link to layouting tracking issue 2024-04-18 16:08:23 +02:00
Emil Ernerfeldt f7fc3b0154 Change GLFW integration recommendation to egui_gl_glfw 2024-02-16 12:53:17 +01:00
Emil Ernerfeldt 8ddd33fc89
README.md: put demo images next to each other 2024-02-06 08:13:37 +01:00
Emil Ernerfeldt 28d3c8e2b5 Improve README.md 2024-02-05 14:11:54 +01:00
Emil Ernerfeldt 67b796faee
Misc cleanup (#3935)
* Improve docstring
* Nicer welcome gif in README
* Misc cleanup
2024-02-01 17:09:35 +01:00
One c735a0b26c
Link to example of File Dialogs (#3835)
<!--
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.
* 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 cranky`.
* 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!
-->
Created as per https://github.com/emilk/egui/discussions/3783

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-01-22 12:13:38 +01:00
Tarek Sabet 301c72ba22
fixed typos in README.md (#3789)
This just fixes two small typos in the readme.
2024-01-09 11:12:09 +01:00
Emil Ernerfeldt 81a47066c6 Add link to `egui-ash` in README.md
Closes https://github.com/emilk/egui/issues/3706
2023-12-18 10:07:50 +01:00
Francisco Ayala Le Brun 6a785d4b47
Taking over egui_glium (#3535)
Hello. I would like to maintain egui_glium. I have already updated my
fork to the newest version of glium. You can find it at:
https://github.com/fayalalebrun/egui_glium

Let me know about next steps regarding access to crates.io.

<!--
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.
* 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 cranky`.
* 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 you PR, but my time is limited!
-->
2023-11-11 18:35:57 +01:00
Emil Ernerfeldt b5e3502067
Add link checking to CI (#3445)
* Add link checking to CI, plus another spell checker

* Only spell-check markdown

* Avoid rate-limiting

* Fix some links

* Disable cspell
2023-10-08 09:30:54 +02:00
Emil Ernerfeldt a128b10ef4 Update Rerun.io logo and copy 2023-09-27 15:27:51 +02:00
Emil Ernerfeldt 8ef443948f
Improve the About windows in the demo library (#3400)
* Tweak size of rerun logo

* Move history of immediate mode to docs

* Add link to Rerun.io from demo-lib's About window
2023-09-27 11:38:52 +02:00
Emil Ernerfeldt dff52eddfd
README.md: new images, better text (#3392)
* Update images in README.md

* Add ferris image to hello_world example

* Clean up and improve README.md, with top-level link to Rerun

* Move sections around
2023-09-26 21:17:43 +02:00
Emil Ernerfeldt fdd493d48f
Misc cleanup (#3381)
* Give credit to recent big-time contributors in the main README.md

* Better named profiling scopes

* Document everything in memory.rs

* Better doc-strings

* Add a section about dependencies to the main README.md

* Improve egui_extras docs

* fix typos
2023-09-24 09:32:31 +02:00
Emil Ernerfeldt 62e27d623a Move README section on writing a new integration to the egui crate docs
Closes https://github.com/emilk/egui/issues/3326
2023-09-10 13:57:24 +02:00
Emil Ernerfeldt cccdfd246e Cleanup ahead of release 2023-05-23 19:53:32 +02:00
Emil Ernerfeldt d7dcfe4dae Remove references to the removed `custom_3d_three-d` example 2023-05-22 17:04:58 +02:00
Emil Ernerfeldt d765c610c1 Update list of Fedora Rawhide dependencies
Closes https://github.com/emilk/egui/issues/2946
2023-05-22 16:43:26 +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 ebeb788b1f
We no longer use tts, so remove speech-related dependencies (#2698) 2023-02-08 18:45:44 +01:00
itfanr 9c270448a6
Add link to `tauri-egui` in README.md
add a 3rd party integration: tauri-egui for tauri
2023-02-04 13:52:47 +01: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
NemuiSen 5725868b57
ggez-egui was renamed to ggegui (#2662) 2023-02-03 10:59:28 +01:00
Emil Ernerfeldt 8ce0e1c520
Avoid deadlocks by using lambdas for context lock (#2625)
ctx.input().key_pressed(Key::A) -> ctx.input(|i| i.key_pressed(Key::A))
2023-01-25 10:24:23 +01:00
lucasmerlin 80ea12877e
Add egui_skia integration to readme (#2483)
* Add egui_skia integration to readme

* sort

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2022-12-19 12:35:42 +01:00
Emil Ernerfeldt 9e3da91a59 Add pronunciation guide at the top of the README 2022-12-06 10:58:51 +01:00
Emil Ernerfeldt 452541d7c2 Add a "sponsored by Rerun" section at the end of the README.md 2022-12-06 10:58:51 +01:00
Matt Campbell 32144d3cb9
Update README section on accessibility (#2392) 2022-12-05 20:40:01 +01:00
heretik31 8e79a5a8ae
Add egui_speedy2d link to README.md (#2211) 2022-11-01 21:24:12 +01:00
Emil Ernerfeldt 2ee9ab3151 Added link to egui-glutin-gl 2022-09-27 23:08:43 +02:00
ComLarsic 162210f90e
Add sdl2_egui_platform to the list of integrations (#2011) 2022-09-06 14:28:59 +02:00
Emil Ernerfeldt 2453756782 Fix broken GitHub source links due to #1940 2022-08-20 15:18:02 +02:00
Milo Moisson cbe22a0371
Update the link to the nannou egui integration. (#1827)
The project has now moved to the official repository. The old is an archived repo.
Thanks
2022-07-21 19:43:42 +02:00
Nazarí González 9c26093fea
Added `notan_egui` as 3rd party integration (#1741) 2022-06-18 16:10:48 +02:00
John Wells f8ce51e5aa
Add screen-13-egui link to README.md (#1709) 2022-06-02 20:55:02 +02:00
Emil Ernerfeldt e6cfa5028e Add link to chinese translation of egui docs 2022-05-29 21:16:32 +02:00
Emil Ernerfeldt 931e716b97
Add egui_wgpu crate (#1564)
Based on https://github.com/hasenbanck/egui_wgpu_backend

`egui-wgpu` is now an official backend for `eframe` (opt-in).

Use the `wgpu` feature flag on `eframe` and the `NativeOptions::renderer` settings to pick it.

Co-authored-by: Nils Hasenbanck <nils@hasenbanck.de>
Co-authored-by: Sven Niederberger <niederberger@embotech.com>
Co-authored-by: Sven Niederberger <73159570+s-nie@users.noreply.github.com>
2022-05-12 09:02:28 +02:00
Emil Ernerfeldt 078be52ff8 README.md: Fix broken links to toggle_switch.rs example code 2022-05-01 15:27:12 +02:00
Emil Ernerfeldt bb421c7e8a
Remove `egui_web` and `epi` (#1545)
* Remove integration name (it is always eframe)

* Remove egui_web crate

* Move egui_web/CHANGELOG.md into eframe/CHANGELOG.md

* Remove all mentions of egui_web

* Remove epi crate and absorb into eframe

* egui_glow: only use puffin on native

* Remove WASM doc from CI (we don't generate it anyways!)

* Remove eframe::epi and improve eframe docs
2022-04-30 10:44:35 +02:00
Nihaal Sangha 5ea51c3f0b
Fix typo in README (#1533) 2022-04-29 00:36:04 +02:00
Emil Ernerfeldt a7b6334784 Misc doc improvements 2022-04-13 22:14:34 +02:00