summaryrefslogtreecommitdiffstats
path: root/wgpu
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-05-07 21:13:51 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-05-07 21:13:51 +0200
commit5b6f3499e114c1694a5878466f8d46e7022e1bba (patch)
tree172f7a05813331a9233b147b67b45417476ed5e0 /wgpu
parent8a0701a0d95989769341846b05ffcc705ae4ee5f (diff)
downloadiced-5b6f3499e114c1694a5878466f8d46e7022e1bba.tar.gz
iced-5b6f3499e114c1694a5878466f8d46e7022e1bba.tar.bz2
iced-5b6f3499e114c1694a5878466f8d46e7022e1bba.zip
Document `present_mode_from_env` in `iced_wgpu`
Diffstat (limited to 'wgpu')
-rw-r--r--wgpu/src/settings.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/wgpu/src/settings.rs b/wgpu/src/settings.rs
index 5e2603ee..b3c3cf6a 100644
--- a/wgpu/src/settings.rs
+++ b/wgpu/src/settings.rs
@@ -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()?;