Commit graph

19 commits

Author SHA1 Message Date
Emil Ernerfeldt
923b67ef9c
Update to winit 0.27.2, glutin 0.29.0, glium 0.32 (#1914) 2022-08-14 16:23:46 +02:00
Emil Ernerfeldt
51052c08e9 code cleanup: Pos2::new -> pos2, Vec2::new -> vec2 2022-07-29 14:34:26 +02:00
Red Artist
935913b1ec
Add Context::request_repaint_after (#1694) 2022-06-22 13:19:13 +02:00
Robert Bragg
a5076d4cc4
egui_winit/wgpu: enable Android support (#1634)
* egui-winit: don't assume window available at init

On Android in particular we can only initialize render state once we
have a native window, after a 'Resumed' lifecycle event. It's still
practical to be able to initialize an egui_winit::State early on
so this adds setters for the max_texture_side and pixels_per_point
that can be called once we have a valid Window and have initialized
a graphics context.

On Wayland, where we need to access the Display for clipboard handling
we now get the Display from the event loop instead of a window.

* egui-wgpu: lazily initialize render + surface state

Enable the renderer and surface state initialization to be deferred
until we know that any winit window we created has a valid native window
and enable the surface state to be updated in case the native window
changes.

In particular these changes help with running on Android where winit
windows will only have a valid native window associated with them
between Resumed and Paused lifecycle events, and so surface creation
(and render state initialization) needs to wait until the first
Resumed event, and the surface needs to be dropped/recreated based on
Paused/Resumed events.
2022-05-22 20:24:41 +02:00
Emil Ernerfeldt
f3e305a646 Replace TODO: with TODO(emilk): and update code guidelines 2022-05-21 16:53:25 +02:00
Emil Ernerfeldt
ed002acc68
Refactor: move things into eframe (#1542)
* Move all epi-related code from egui_glow into eframe

* Move epi stuff from egui-winit into eframe

* Remove mention of epi in egui

* Remove mention of epi in egui_glium

* Remove trait epi::NativeTexture

* Remove confusing mentions of epi

* Refactor egui_web: break up into smaller files

* Clean up feature flags further, and update changelogs

* Clean up check.sh

* Small cleanup of egui_web/Cargo.toml

* Fix dependencies for pure_glow example

* Fix clippy false positive
2022-04-29 08:17:49 +02:00
Emil Ernerfeldt
2ae93c40ab
Move examples out of eframe/examples into examples/ (#1486)
* Move examples out of eframe/examples into examples/

Give each example a `Cargo.toml` and `src/main.rs`.
This makes it easier for people to use as templates.

* Update README.md with more deps needed on vanilla Ubuntu
* Install libgtk-3-dev on CI, hoping that will fix something
2022-04-13 16:13:24 +02:00
Emil Ernerfeldt
5c68edbb15 Clippy fixes 2022-03-21 22:14:25 +01:00
Emil Ernerfeldt
c8f6cae362
eframe app creation refactor (#1363)
* Change how eframe apps are created
* eframe: re-export epi::* so users don't need to care about what epi is
2022-03-16 15:39:48 +01:00
Emil Ernerfeldt
29c52e8eb6
Remove epi backend from egui_glow (#1361) 2022-03-13 22:49:24 +01:00
Emil Ernerfeldt
66d80e2519
Texture loading in egui (#1110)
* Move texture allocation into epaint/egui proper
* Add TextureHandle
* egui_glow: cast using bytemuck instead of unsafe code
* Optimize glium painter
* Optimize WebGL
* Add example of loading an image from file
2022-01-15 13:59:52 +01:00
Emil Ernerfeldt
753d709d3d
Hide console on windows for all examples in release builds (#1008) 2021-12-30 22:43:53 +01:00
d10sfan
90757ca221
Add Button::image_and_text (#832)
* Support image button with text
* Add example (`cargo run --example native_texture`)
2021-11-13 13:17:02 +01:00
Emil Ernerfeldt
ddd5f6f4f6
winit: don't explicitly handle Cmd-Q and Alt-F4 (#881)
Closes https://github.com/emilk/egui/issues/877

Still a problem: https://github.com/rust-windowing/winit/issues/1998
2021-11-07 20:58:02 +01:00
Emil Ernerfeldt
1dbe608e73
Refactor integrations (#871)
* Unify code in egui_glium and egui_glow into egui_winit::EpiIntegration
* Simplify `EguiGlium` interface
* Simplify `EguiGlow` interface
* egui_web refactor: merge `WebBackend` into `AppRunner`
2021-11-03 13:45:51 +01:00
Emil Ernerfeldt
cf17cb2065 egui_glium: allow sharing a native glium texture using Rc 2021-09-20 22:52:29 +02:00
Emil Ernerfeldt
cfb6b31914 Improve native_texture.rs demo 2021-09-20 22:39:44 +02:00
Emil Ernerfeldt
a5a5d6176d Improve the frame around ImageButton
Helps https://github.com/emilk/egui/issues/721
2021-09-20 22:37:21 +02:00
triangle drawer
203d571c8b
Add api for accessing backend texture via epi (#695)
* Define NativeTexture trait for offscreen rendering
add demo for NativeTexture trait

* write changelog

* add comment for native texture example

* formatting

* add license of Rust logo

* NativeTexture trait method rename
remove duplicate function with native texture
remove rust logo

* deprecated notice for register_glium_texture,register_webgl_texture

* collect deprecated notice
2021-09-05 11:00:45 +02:00