diff options
Diffstat (limited to 'wgpu/src/window')
-rw-r--r-- | wgpu/src/window/backend.rs | 1 | ||||
-rw-r--r-- | wgpu/src/window/swap_chain.rs | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/wgpu/src/window/backend.rs b/wgpu/src/window/backend.rs index 0e4f02c9..87779bea 100644 --- a/wgpu/src/window/backend.rs +++ b/wgpu/src/window/backend.rs @@ -3,6 +3,7 @@ use crate::{window::SwapChain, Renderer, Settings, Target}; use iced_native::MouseCursor; use raw_window_handle::HasRawWindowHandle; +/// A window graphics backend for iced powered by `wgpu`. #[derive(Debug)] pub struct Backend { device: wgpu::Device, diff --git a/wgpu/src/window/swap_chain.rs b/wgpu/src/window/swap_chain.rs index 3760e8a2..6f545fce 100644 --- a/wgpu/src/window/swap_chain.rs +++ b/wgpu/src/window/swap_chain.rs @@ -12,6 +12,9 @@ pub struct SwapChain { impl SwapChain {} impl SwapChain { + /// Creates a new [`SwapChain`] for the given surface. + /// + /// [`SwapChain`]: struct.SwapChain.html pub fn new( device: &wgpu::Device, surface: &wgpu::Surface, @@ -24,6 +27,10 @@ impl SwapChain { } } + /// Returns the next frame of the [`SwapChain`] alongside its [`Viewport`]. + /// + /// [`SwapChain`]: struct.SwapChain.html + /// [`Viewport`]: ../struct.Viewport.html pub fn next_frame(&mut self) -> (wgpu::SwapChainOutput<'_>, &Viewport) { (self.raw.get_next_texture(), &self.viewport) } |