Skip to content

Commit

Permalink
Add documentation to the WindowDescriptor struct.
Browse files Browse the repository at this point in the history
  • Loading branch information
object71 committed May 16, 2022
1 parent 7462f21 commit 01342e4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions crates/bevy_window/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,12 +602,26 @@ impl Window {
}
}

/// Describes the information needed for a window creation like width, height, title, present_mode, etc.
/// This should be set up before adding the [`WindowPlugin`]. Most of these settings can also later
/// be configured through the [`Window`] resource.
///
/// See `examples/window/window_settings.rs` for usage.
///
/// [`Window`]: crate::Window
/// [`WindowPlugin`]: crate::WindowPlugin
#[derive(Debug, Clone)]
pub struct WindowDescriptor {
/// The requested logical width of the window's client area.
pub width: f32,
/// The requested logical height of the window's client area.
pub height: f32,
/// The position on the screen that the window will be placed on.
pub position: Option<Vec2>,
pub resize_constraints: WindowResizeConstraints,
/// Overrides the [`Window`]'s ratio of physical pixels to logical pixels
///
/// [`Window`]: crate::Window
pub scale_factor_override: Option<f64>,
pub title: String,
#[doc(alias = "vsync")]
Expand All @@ -625,6 +639,8 @@ pub struct WindowDescriptor {
/// macOS X transparent works with winit out of the box, so this issue might be related to: <https://github.com/gfx-rs/wgpu/issues/687>
/// Windows 11 is related to <https://github.com/rust-windowing/winit/issues/2082>
pub transparent: bool,
/// A string that represents a DOM query selector for the target canvas element.
/// Use this in case you want to create the canvas element yourself.
#[cfg(target_arch = "wasm32")]
pub canvas: Option<String>,
}
Expand Down

0 comments on commit 01342e4

Please sign in to comment.