[][src]Struct swsurface::SwWindow

pub struct SwWindow { /* fields omitted */ }

A software-rendered window.

This is a safe wrapper around Surface and winit::window::Window. For each method, only a synopsis is provided here. See Surface's documentation for a full documentation.

Methods

impl SwWindow[src]

pub fn new(window: Window, context: &Context, config: &Config) -> Self[src]

Construct a SwWindow by wrapping an existing Window.

pub fn into_window(self) -> Window[src]

Detach the surface and get the wrapped winit::window::Window.

pub unsafe fn split(self) -> (Surface, Window)[src]

Split the Window apart from the Surface.

Unsafety: The Surface must be dropped before the Window.

pub fn window(&self) -> &Window[src]

Get a reference to the wrapped winit::window::Window.

pub fn update_surface(&self, extent: [u32; 2], format: Format)[src]

Update the properties of the surface.

pub fn update_surface_to_fit(&self, format: Format)[src]

Update the properties of the surface. The surface size is automatically derived based on the window size.

pub fn supported_formats(&self) -> impl Iterator<Item = Format> + '_[src]

Enumerate supported pixel formats.

pub fn image_info(&self) -> ImageInfo[src]

Get the ImageInfo describing the current swapchain images.

pub fn num_images(&self) -> usize[src]

Get the number of swapchain images.

pub fn does_preserve_image(&self) -> bool[src]

Get a flag indicating whether swapchain images preserve their contents when their indices are used again.

pub fn poll_next_image(&self) -> Option<usize>[src]

Get the index of the next available swapchain image. Blocks the current thread.

pub fn lock_image(&self, i: usize) -> impl Deref<Target = [u8]> + DerefMut + '_[src]

Lock a swapchain image at index i to access its contents.

pub fn present_image(&self, i: usize)[src]

Enqueue the presentation of a swapchain image at index i.

Trait Implementations

impl Debug for SwWindow[src]

impl Drop for SwWindow[src]

Auto Trait Implementations

impl !RefUnwindSafe for SwWindow

impl !Send for SwWindow

impl !Sync for SwWindow

impl Unpin for SwWindow

impl !UnwindSafe for SwWindow

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erased for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.