diff --git a/crates/egui/src/data/output.rs b/crates/egui/src/data/output.rs index 20b782f7..6c5103b3 100644 --- a/crates/egui/src/data/output.rs +++ b/crates/egui/src/data/output.rs @@ -27,6 +27,9 @@ pub struct FullOutput { pub pixels_per_point: f32, /// All the active viewports, including the root. + /// + /// It is up to the integration to spawn a native window for each viewport, + /// and to close any window that no longer has a viewport in this map. pub viewport_output: ViewportIdMap, } diff --git a/crates/egui/src/viewport.rs b/crates/egui/src/viewport.rs index 740b604d..d10d1389 100644 --- a/crates/egui/src/viewport.rs +++ b/crates/egui/src/viewport.rs @@ -964,6 +964,9 @@ impl ViewportCommand { } /// Describes a viewport, i.e. a native window. +/// +/// This is returned by [`crate::Context::run`] on each frame, and should be applied +/// by the integration. #[derive(Clone)] pub struct ViewportOutput { /// Id of our parent viewport. @@ -976,6 +979,10 @@ pub struct ViewportOutput { pub class: ViewportClass, /// The window attrbiutes such as title, position, size, etc. + /// + /// Use this when first constructing the native window. + /// Also check for changes in it using [`ViewportBuilder::patch`], + /// and apply them as needed. pub builder: ViewportBuilder, /// The user-code that shows the GUI, used for deferred viewports.