pub trait Handle: Sized {
// Required methods
fn wgpu_device(&self) -> &Device;
fn wgpu_queue(&self) -> &Queue;
// Provided methods
fn make_blank_texture(&self, size: Dimension) -> OwnedTexture<'_, Self> { ... }
fn make_texture(
&self,
size: Dimension,
data: &[u8]
) -> Result<OwnedTexture<'_, Self>, Error> { ... }
}
Expand description
A handle to the G2d API.
Required Methods§
sourcefn wgpu_device(&self) -> &Device
fn wgpu_device(&self) -> &Device
The wgpu::Device
this Handle uses.
sourcefn wgpu_queue(&self) -> &Queue
fn wgpu_queue(&self) -> &Queue
The wgpu::Queue
this Handle uses.
Provided Methods§
sourcefn make_blank_texture(&self, size: Dimension) -> OwnedTexture<'_, Self>
fn make_blank_texture(&self, size: Dimension) -> OwnedTexture<'_, Self>
Creates a new Texture with the provided size. Leaves the texture blank.
NOTE: G2d textures default to the Rgba8UnormSrgb
format.
sourcefn make_texture(
&self,
size: Dimension,
data: &[u8]
) -> Result<OwnedTexture<'_, Self>, Error>
fn make_texture( &self, size: Dimension, data: &[u8] ) -> Result<OwnedTexture<'_, Self>, Error>
Object Safety§
This trait is not object safe.