[−][src]Struct swsurface::SwWindow
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[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]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,