Struct wgpu_graphics::Wgpu2d
source · pub struct Wgpu2d<'a> { /* private fields */ }Expand description
The resource needed for rendering 2D.
Implementations
sourceimpl<'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
) -> CommandBufferwhere
F: FnOnce(Context, &mut WgpuGraphics<'_>),
pub fn draw<F>(
&mut self,
device: &Device,
config: &SurfaceConfiguration,
output_view: &TextureView,
viewport: Viewport,
f: F
) -> CommandBufferwhere
F: FnOnce(Context, &mut WgpuGraphics<'_>),
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> !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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more