1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! Apple Liquid Glass style widgets for egui, rendered on the GPU through
//! egui-wgpu paint callbacks.
//!
//! Requires egui / egui-wgpu 0.35 and wgpu 29. With eframe, enable its `wgpu`
//! feature and select `eframe::Renderer::Wgpu`; the glow renderer is unsupported.
//!
//! ```no_run
//! # fn setup(ctx: &egui::Context, rs: &egui_wgpu::RenderState, wallpaper: egui::ColorImage) {
//! egui_glass::init(rs, 1);
//! egui_glass::set_backdrop(ctx, rs, &wallpaper);
//! # }
//! # fn ui(ui: &mut egui::Ui) {
//! egui_glass::show_backdrop(ui, ui.max_rect());
//! egui_glass::Glass::new(egui_glass::GlassStyle::regular()).show(ui, |ui| {
//! ui.label("Hello");
//! });
//! # }
//! ```
//!
//! Glass refracts a *backdrop image* you register once (or whenever it changes),
//! not the live framebuffer: egui paints in a single pass, so the pixels behind a
//! widget are not available to a shader in the same frame. [`LiveBackdrop`]
//! lifts that limit by rendering your content a second time off screen.
//!
//! # Integration order
//!
//! Call [`init`] once per renderer, then create a [`LiveBackdrop`] if needed,
//! then upload the backdrop and register native textures. Draw the backdrop
//! before glass each frame. The MSAA count passed to [`init`] must match the
//! host renderer (0 is treated as 1).
//!
//! # Features
//!
//! No default features. The optional `serde` feature enables serialization and
//! deserialization of [`GlassStyle`], with defaults for missing fields.
//!
//! See the [guide](https://github.com/heonny/egui-glass/blob/main/docs/guide.md)
//! and [reference](https://github.com/heonny/egui-glass/blob/main/docs/reference.md)
//! for integration details, performance costs, and limitations.
pub use ;
pub use LiveBackdrop;
pub use init;
pub use GlassSlider;
pub use GlassStyle;
pub use ;