Struct draw2d::graphics::Graphics [−][src]
pub struct Graphics { pub texture_atlas: GpuAtlas, pub clear_color: [f32; 4], pub device: Arc<Device>, // some fields omitted }
Expand description
The application’s graphics subsystem.
Fields
texture_atlas: GpuAtlas
The graphics subsystem’s texture atlas.
clear_color: [f32; 4]
the color used to clear the screen
device: Arc<Device>
The vulkan device used by all resources in the graphics subsystem.
Implementations
Instantiate the graphics subsystem.
Add a new graphics layer to the top of the rendering stack.
This layer will be rendered above all other existing layers.
Add a new graphics layer to the bottom of the rendering stack.
This layer will be rendered below all other existing layers.
Return a mutable reference to the layer referenced by the handle
PANICs if the layer handle doesn’t refer to an actual layer.
Render a single frame to the screen.
Replace the swapchain and all dependent resources in the Triangle subsystem.
Trait Implementations
unsafe fn create_sampler(
&self,
debug_name: impl Into<String>,
sampler_create_info: SamplerCreateInfo
) -> Result<Sampler>
unsafe fn create_sampler(
&self,
debug_name: impl Into<String>,
sampler_create_info: SamplerCreateInfo
) -> Result<Sampler>
Create a new sampler using the Graphics subsystem’s logical device.
Destroy a sampler. Read more
fn create_empty_2d_texture(
&self,
name: impl Into<String>,
width: u32,
height: u32,
mip_levels: u32
) -> Result<TextureImage>
fn create_empty_2d_texture(
&self,
name: impl Into<String>,
width: u32,
height: u32,
mip_levels: u32
) -> Result<TextureImage>
Create an empty 2d texture object using the Graphic subsystem’s logical device.
This implementation is generally SAFE because it forces the device to idle prior to removing the texture.
The atlas’s current version.
Build the array of descriptor image info objects which can be used to write all of this atlas’s textures into a descriptor set. Read more
Add a named sampler to the atlas. Samplers can be persistently bound to individual textures. Read more
fn bind_sampler_to_texture(
&mut self,
sampler_handle: SamplerHandle,
texture_handle: TextureHandle
) -> Result<()>
fn bind_sampler_to_texture(
&mut self,
sampler_handle: SamplerHandle,
texture_handle: TextureHandle
) -> Result<()>
Bind a sampler to a texture. Binding are persistent - they do not change until this method is called again. Read more
Add a texture to the atlas. The atlas owns the texture and will destroy it when the atlas is dropped. Read more
Read a file from the local filesystem into memory as a usable texture.
Auto Trait Implementations
impl RefUnwindSafe for Graphics
impl UnwindSafe for Graphics
Blanket Implementations
Mutably borrows from an owned value. Read more
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
Checks if self
is actually part of its subset T
(and can be converted to it).
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
The inclusion map: converts self
to the equivalent element of its superset.