[][src]Struct pixels::SurfaceTexture

pub struct SurfaceTexture<'win, W: HasRawWindowHandle> { /* fields omitted */ }

A logical texture for a window surface.

Implementations

impl<'win, W: HasRawWindowHandle> SurfaceTexture<'win, W>[src]

pub fn new(width: u32, height: u32, window: &'win W) -> SurfaceTexture<'win, W>[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::SurfaceTexture;
use winit::event_loop::EventLoop;
use winit::window::Window;

let event_loop = EventLoop::new();
let window = Window::new(&event_loop).unwrap();
let size = window.inner_size();

let width = size.width;
let height = size.height;

let surface_texture = SurfaceTexture::new(width, height, &window);

Panics

Panics when width or height are 0.

Trait Implementations

impl<'win, W: Debug + HasRawWindowHandle> Debug for SurfaceTexture<'win, W>[src]

Auto Trait Implementations

impl<'win, W> RefUnwindSafe for SurfaceTexture<'win, W> where
    W: RefUnwindSafe

impl<'win, W> Send for SurfaceTexture<'win, W> where
    W: Sync

impl<'win, W> Sync for SurfaceTexture<'win, W> where
    W: Sync

impl<'win, W> Unpin for SurfaceTexture<'win, W>

impl<'win, W> UnwindSafe for SurfaceTexture<'win, W> where
    W: RefUnwindSafe

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> 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.