pub struct Wgpu2d { /* private fields */ }Expand description
The resource needed for rendering 2D.
Implementations§
Source§impl Wgpu2d
impl Wgpu2d
Sourcepub fn new<'b>(device: Arc<Device>, config: &'b SurfaceConfiguration) -> Self
pub fn new<'b>(device: Arc<Device>, config: &'b SurfaceConfiguration) -> Self
Creates a new Wgpu2d.
Sourcepub fn draw<F, U>(
&mut self,
config: &SurfaceConfiguration,
output_view: &TextureView,
viewport: Viewport,
f: F,
) -> (U, CommandBuffer)
pub fn draw<F, U>( &mut self, config: &SurfaceConfiguration, output_view: &TextureView, viewport: Viewport, f: F, ) -> (U, 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 Freeze for Wgpu2d
impl !RefUnwindSafe for Wgpu2d
impl Send for Wgpu2d
impl Sync for Wgpu2d
impl Unpin for Wgpu2d
impl !UnwindSafe for Wgpu2d
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§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