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
sourceimpl 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.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Texture
impl Send for Texture
impl Sync for Texture
impl Unpin for Texture
impl UnwindSafe for Texture
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more