Struct gfx_graphics::Gfx2d
source · pub struct Gfx2d<R: Resources> { /* private fields */ }
Expand description
The data used for drawing 2D graphics.
Stores buffers and PSO objects needed for rendering 2D graphics.
Implementations§
source§impl<R: Resources> Gfx2d<R>
impl<R: Resources> Gfx2d<R>
sourcepub fn new<F>(opengl: OpenGL, factory: &mut F) -> Selfwhere
F: Factory<R>,
pub fn new<F>(opengl: OpenGL, factory: &mut F) -> Selfwhere
F: Factory<R>,
Creates a new Gfx2d object.
sourcepub fn draw<C, F, U>(
&mut self,
encoder: &mut Encoder<R, C>,
output_color: &RenderTargetView<R, Srgba8>,
output_stencil: &DepthStencilView<R, DepthStencil>,
viewport: Viewport,
f: F
) -> U
pub fn draw<C, F, U>( &mut self, encoder: &mut Encoder<R, C>, output_color: &RenderTargetView<R, Srgba8>, output_stencil: &DepthStencilView<R, DepthStencil>, viewport: Viewport, f: F ) -> U
Renders graphics to a Gfx renderer.
Auto Trait Implementations§
impl<R> Freeze for Gfx2d<R>
impl<R> !RefUnwindSafe for Gfx2d<R>
impl<R> Send for Gfx2d<R>
impl<R> Sync for Gfx2d<R>
impl<R> Unpin for Gfx2d<R>
impl<R> !UnwindSafe for Gfx2d<R>
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