Struct pixels::SurfaceTexture[][src]

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

A logical texture for a window surface.

Implementations

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 surface_texture = SurfaceTexture::new(size.width, size.height, &window);
Panics

Panics when width or height are 0.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.