pub struct Wgpu2d<'a> { /* private fields */ }
Expand description
The resource needed for rendering 2D.
Implementations§
Source§impl<'a> Wgpu2d<'a>
impl<'a> Wgpu2d<'a>
Sourcepub fn new<'b>(device: &'a Device, config: &'b SurfaceConfiguration) -> Self
pub fn new<'b>(device: &'a Device, config: &'b SurfaceConfiguration) -> Self
Creates a new Wgpu2d
.
Sourcepub fn draw<F>(
&mut self,
device: &Device,
config: &SurfaceConfiguration,
output_view: &TextureView,
viewport: Viewport,
f: F,
) -> CommandBuffer
pub fn draw<F>( &mut self, device: &Device, config: &SurfaceConfiguration, output_view: &TextureView, viewport: Viewport, f: F, ) -> CommandBuffer
Performs 2D graphics operations and returns encoded commands.
To actually draw on a window surface, you must submit
the returned CommandBuffer
.
Auto Trait Implementations§
impl<'a> Freeze for Wgpu2d<'a>
impl<'a> !RefUnwindSafe for Wgpu2d<'a>
impl<'a> Send for Wgpu2d<'a>
impl<'a> Sync for Wgpu2d<'a>
impl<'a> Unpin for Wgpu2d<'a>
impl<'a> !UnwindSafe for Wgpu2d<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more