Trait draw2d::graphics::texture_atlas::TextureAtlas[][src]

pub trait TextureAtlas {
    fn version(&self) -> AtlasVersion;
fn build_descriptor_image_info(&self) -> Vec<DescriptorImageInfo>;
fn add_sampler(&mut self, sampler: Sampler) -> Result<SamplerHandle>;
fn add_texture(&mut self, texture: TextureImage) -> Result<TextureHandle>;
unsafe fn take_texture(
        &mut self,
        texture_handle: TextureHandle
    ) -> Result<TextureImage>;
fn bind_sampler_to_texture(
        &mut self,
        sampler_handle: SamplerHandle,
        texture_handle: TextureHandle
    ) -> Result<()>; }
Expand description

A type which owns a collection of texture objects that can be bound once per frame and individually accessed in calls to vkDraw.

Required methods

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.

Add a named sampler to the atlas. Samplers can be persistently bound to individual textures.

Add a texture to the atlas. The atlas owns the texture and will destroy it when the atlas is dropped.

Take ownership of a texture owned by this atlas.

Unsafe Because

  • the caller must make sure that the texture atlas is not in use when this method is called

Bind a sampler to a texture. Binding are persistent - they do not change until this method is called again.

Implementors