Skip to content

Commit

Permalink
Add vsync alias to PresentMode and additional doc links
Browse files Browse the repository at this point in the history
  • Loading branch information
aloucks committed Jan 30, 2022
1 parent f806180 commit a94351d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/bevy_window/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ pub struct WindowId(Uuid);
/// `Fifo`.
///
/// `Immediate` or `Mailbox` will gracefully fallback to `Fifo` when unavailable.
///
/// The presentaion mode may be declared in the [`WindowDescriptor`](WindowDescriptor::present_mode)
/// or updated on a [`Window`](Window::set_present_mode).
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
#[doc(alias = "vsync")]
pub enum PresentMode {
/// The presentation engine does **not** wait for a vertical blanking period and
/// the request is presented immediately. This is a low-latency presentation mode,
Expand Down Expand Up @@ -454,11 +458,13 @@ impl Window {
}

#[inline]
#[doc(alias = "vsync")]
pub fn present_mode(&self) -> PresentMode {
self.present_mode
}

#[inline]
#[doc(alias = "set_vsync")]
pub fn set_present_mode(&mut self, present_mode: PresentMode) {
self.present_mode = present_mode;
self.command_queue
Expand Down Expand Up @@ -587,6 +593,7 @@ pub struct WindowDescriptor {
pub resize_constraints: WindowResizeConstraints,
pub scale_factor_override: Option<f64>,
pub title: String,
#[doc(alias = "vsync")]
pub present_mode: PresentMode,
pub resizable: bool,
pub decorations: bool,
Expand Down

0 comments on commit a94351d

Please sign in to comment.