1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-02 06:40:06 -04:00

Deduplicate code found in both egui_glium and egui_glow (#819)

* Move window building to egui-winit

* Move icon loading to egui-winit

* `use glow::HasContext;` -> `use glow::HasContext as _;`

* Move FileStorage into epi behind a feature flag

* De-duplicate screen_size_in_pixels and native_pixels_per_point

* Move creation of FileStorage to epi

* Handle epi app output (window size changes etc) in egui-winit

* Move app and memory persistence and autosave logic to egui-winit

* fix check.sh

* Make the epi backend opt-in for egui_glium and egui_glow

* Fix persistence

* Add integration name to epi::IntegrationInfo and the demo

* Clean up Cargo.toml files and fix making egui_glium optional

* fix typo

* Make egui_glium compile without the `epi` feature
This commit is contained in:
Emil Ernerfeldt
2021-10-19 21:40:55 +02:00
committed by GitHub
parent 844dd9d7a4
commit 8178d23d19
26 changed files with 548 additions and 741 deletions

View File

@@ -78,6 +78,10 @@
#![allow(clippy::manual_range_contains)]
#![warn(missing_docs)] // Let's keep `epi` well-documented.
/// File storage which can be used by native backends.
#[cfg(feature = "file_storage")]
pub mod file_storage;
pub use egui; // Re-export for user convenience
// ----------------------------------------------------------------------------
@@ -296,6 +300,9 @@ pub struct WebInfo {
/// Information about the integration passed to the use app each frame.
#[derive(Clone, Debug)]
pub struct IntegrationInfo {
/// The name of the integration, e.g. `egui_web`, `egui_glium`, `egui_glow`
pub name: &'static str,
/// If the app is running in a Web context, this returns information about the environment.
pub web_info: Option<WebInfo>,