pub struct SwWindow { /* private fields */ }
Expand description
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.
Implementations§
Source§impl SwWindow
impl SwWindow
Sourcepub fn new(window: Window, context: &Context, config: &Config) -> Self
pub fn new(window: Window, context: &Context, config: &Config) -> Self
Construct a SwWindow
by wrapping an existing Window
.
Sourcepub fn into_window(self) -> Window
pub fn into_window(self) -> Window
Detach the surface and get the wrapped winit::window::Window
.
Sourcepub unsafe fn split(self) -> (Surface, Window)
pub unsafe fn split(self) -> (Surface, Window)
Split the Window
apart from the Surface
.
Unsafety: The Surface
must be dropped before the Window
.
Sourcepub fn window(&self) -> &Window
pub fn window(&self) -> &Window
Get a reference to the wrapped winit::window::Window
.
Sourcepub fn update_surface(&self, extent: [u32; 2], format: Format)
pub fn update_surface(&self, extent: [u32; 2], format: Format)
Update the properties of the surface.
Sourcepub fn update_surface_to_fit(&self, format: Format)
pub fn update_surface_to_fit(&self, format: Format)
Update the properties of the surface. The surface size is automatically derived based on the window size.
Sourcepub fn supported_formats(&self) -> impl Iterator<Item = Format> + '_
pub fn supported_formats(&self) -> impl Iterator<Item = Format> + '_
Enumerate supported pixel formats.
Sourcepub fn image_info(&self) -> ImageInfo
pub fn image_info(&self) -> ImageInfo
Get the ImageInfo
describing the current swapchain images.
Sourcepub fn num_images(&self) -> usize
pub fn num_images(&self) -> usize
Get the number of swapchain images.
Sourcepub fn does_preserve_image(&self) -> bool
pub fn does_preserve_image(&self) -> bool
Get a flag indicating whether swapchain images preserve their contents when their indices are used again.
Sourcepub fn poll_next_image(&self) -> Option<usize>
pub fn poll_next_image(&self) -> Option<usize>
Get the index of the next available swapchain image. Blocks the current thread.
Sourcepub fn lock_image(&self, i: usize) -> impl Deref<Target = [u8]> + DerefMut + '_
pub fn lock_image(&self, i: usize) -> impl Deref<Target = [u8]> + DerefMut + '_
Lock a swapchain image at index i
to access its contents.
Sourcepub fn present_image(&self, i: usize)
pub fn present_image(&self, i: usize)
Enqueue the presentation of a swapchain image at index i
.