Skip to content

Commit

Permalink
Document present_mode_from_env in iced_wgpu
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed May 7, 2024
1 parent 8a0701a commit 5b6f349
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions wgpu/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,18 @@ impl From<graphics::Settings> for Settings {
}
}

/// Obtains a [`wgpu::PresentMode`] from the current environment
/// configuration, if set.
///
/// The value returned by this function can be changed by setting
/// the `ICED_PRESENT_MODE` env variable. The possible values are:
///
/// - `vsync` → [`wgpu::PresentMode::AutoVsync`]
/// - `no_vsync` → [`wgpu::PresentMode::AutoNoVsync`]
/// - `immediate` → [`wgpu::PresentMode::Immediate`]
/// - `fifo` → [`wgpu::PresentMode::Fifo`]
/// - `fifo_relaxed` → [`wgpu::PresentMode::FifoRelaxed`]
/// - `mailbox` → [`wgpu::PresentMode::Mailbox`]
pub fn present_mode_from_env() -> Option<wgpu::PresentMode> {
let present_mode = std::env::var("ICED_PRESENT_MODE").ok()?;

Expand Down

0 comments on commit 5b6f349

Please sign in to comment.