pub struct Texture { /* private fields */ }Expand description
Immutable texture object stored in GPU memory.
Internally this uses reference counting, so cloning a is very cheap and reuses the texture contents
Implementations§
source§impl Texture
impl Texture
sourcepub fn update_rectangle(
&self,
pos_x: u32,
pos_y: u32,
width: u32,
height: u32,
data: &[u8]
)
pub fn update_rectangle( &self, pos_x: u32, pos_y: u32, width: u32, height: u32, data: &[u8] )
Updates a subrectangle of a texture with new data.
Added mainly for egui support, but might have other interesting uses.
sourcepub fn format(&self) -> TextureFormat
pub fn format(&self) -> TextureFormat
Retrieves the texture’s format.
sourcepub fn dimensions(&self) -> (usize, usize, usize)
pub fn dimensions(&self) -> (usize, usize, usize)
Retrieves the texture’s dimensions.
sourcepub fn handle(&self) -> TextureHandle
pub fn handle(&self) -> TextureHandle
Retrieves the texture’s handle.