[−][src]Struct pixels::SurfaceTexture
A logical texture for a window surface.
Implementations
impl SurfaceTexture
[src]
pub fn new(width: u32, height: u32, surface: Surface) -> SurfaceTexture
[src]
Create a logical texture for a window surface.
It is recommended (but not required) that the width
and height
are equivalent to the
physical dimensions of the surface
. E.g. scaled by the HiDPI factor.
Examples
use pixels::{wgpu::Surface, SurfaceTexture}; use winit::event_loop::EventLoop; use winit::window::Window; let event_loop = EventLoop::new(); let window = Window::new(&event_loop).unwrap(); let surface = Surface::create(&window); let size = window.inner_size(); let width = size.width; let height = size.height; let surface_texture = SurfaceTexture::new(width, height, surface);
Panics
Panics when width
or height
are 0.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for SurfaceTexture
impl Send for SurfaceTexture
impl Sync for SurfaceTexture
impl Unpin for SurfaceTexture
impl UnwindSafe for SurfaceTexture
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> 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>,