egui/crates/egui_glow
Andreas Reich f9f5db9885
PaintCallbackInfo::viewport_in_pixels now guarantees to stay in bounds (#3604)
* Fixes https://github.com/rerun-io/rerun/issues/4297
* tested against a very hasty and incomplete port of egui/trunk, found
[here](https://github.com/rerun-io/rerun/tree/andreas/experimental-egui-trunk)


In rare cases in can happen that the viewport returned by
`PaintCallbackInfo` is outside the bounds of the screen.
for at least [wgpu/webgpu in
particular](https://www.w3.org/TR/webgpu/#dom-gpurenderpassencoder-setviewport)
this is invalid usage, other backends might be affected as well.
Since this happened due to a float rounding error (in one repro case I
had I got (width==1126.5625) + (offset=715.4376) = 1842.0001 for a
resolution of 1842) I decided to do away with fractional values on the
viewport alltogether. They _technically_ make sense since a viewport is
only specifying the NDC to pixel coordinate conversion, but practically
this may lead to surprising sub-sampling issues.

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-11-22 21:01:38 +01:00
..
examples Change `Arc<glow::Context>` to `Rc<glow::Context>` (#3598) 2023-11-21 17:13:46 +01:00
src PaintCallbackInfo::viewport_in_pixels now guarantees to stay in bounds (#3604) 2023-11-22 21:01:38 +01:00
CHANGELOG.md Release 0.23.0 - New image API 2023-09-28 08:44:33 +02:00
Cargo.toml Update puffin to 0.18 (#3600) 2023-11-21 17:58:33 +01:00
README.md We no longer use tts, so remove speech-related dependencies (#2698) 2023-02-08 18:45:44 +01:00

README.md

egui_glow

Latest version Documentation MIT Apache

This crates provides bindings between egui and glow which allows you to:

  • Render egui using glow on both native and web.
  • Write cross platform native egui apps (with the winit feature).

To write web apps using glow you can use eframe (which uses egui_glow for rendering).

To use on Linux, first run:

sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev

This crate optionally depends on egui-winit.

Text the example with:

cargo run -p egui_glow --example pure_glow --features=winit,egui/default_fonts