pub struct WindowSurface { /* private fields */ }Expand description
A window’s swapchain.
Implementations§
Source§impl WindowSurface
impl WindowSurface
Sourcepub fn create_surface(
instance: &Instance,
window: impl DisplayAndWindowHandle + 'static,
) -> KovaResult<Surface<'static>>
pub fn create_surface( instance: &Instance, window: impl DisplayAndWindowHandle + 'static, ) -> KovaResult<Surface<'static>>
Creates a raw surface for a window handle.
pub fn new( gpu: &GpuContext, surface: Surface<'static>, width: u32, height: u32, options: SurfaceOptions, ) -> KovaResult<WindowSurface>
pub fn resize(&mut self, gpu: &GpuContext, width: u32, height: u32)
pub fn size(&self) -> (u32, u32)
pub fn format(&self) -> TextureFormat
Sourcepub fn acquire(&mut self, gpu: &GpuContext) -> Option<SurfaceTexture>
pub fn acquire(&mut self, gpu: &GpuContext) -> Option<SurfaceTexture>
Acquires the next frame, reconfiguring the swapchain if needed.
Returns None when the frame should be skipped (minimized, timeout).
Auto Trait Implementations§
impl !Freeze for WindowSurface
impl !RefUnwindSafe for WindowSurface
impl !UnwindSafe for WindowSurface
impl Send for WindowSurface
impl Sync for WindowSurface
impl Unpin for WindowSurface
impl UnsafeUnpin for WindowSurface
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more