pub trait RaylibTexture2D: AsRef<Texture2D> + AsMut<Texture2D> {
// Provided methods
fn width(&self) -> i32 { ... }
fn height(&self) -> i32 { ... }
fn mipmaps(&self) -> i32 { ... }
fn format(&self) -> i32 { ... }
fn update_texture(&mut self, pixels: &[u8]) -> Result<(), Error> { ... }
fn update_texture_rec(
&mut self,
rec: impl Into<Rectangle>,
pixels: &[u8],
) -> Result<(), Error> { ... }
fn load_image(&self) -> Result<Image, Error> { ... }
fn gen_texture_mipmaps(&mut self) { ... }
fn set_texture_filter(&self, _: &RaylibThread, filter_mode: TextureFilter) { ... }
fn set_texture_wrap(&self, _: &RaylibThread, wrap_mode: TextureWrap) { ... }
fn is_texture_valid(&self) -> bool { ... }
}
Provided Methods§
fn width(&self) -> i32
fn height(&self) -> i32
fn mipmaps(&self) -> i32
fn format(&self) -> i32
Sourcefn update_texture(&mut self, pixels: &[u8]) -> Result<(), Error>
fn update_texture(&mut self, pixels: &[u8]) -> Result<(), Error>
Updates GPU texture with new data.
Sourcefn update_texture_rec(
&mut self,
rec: impl Into<Rectangle>,
pixels: &[u8],
) -> Result<(), Error>
fn update_texture_rec( &mut self, rec: impl Into<Rectangle>, pixels: &[u8], ) -> Result<(), Error>
Update GPU texture rectangle with new data
Sourcefn load_image(&self) -> Result<Image, Error>
fn load_image(&self) -> Result<Image, Error>
Gets pixel data from GPU texture and returns an Image
.
Fairly sure this would never fail. If it does wrap in result.
Sourcefn gen_texture_mipmaps(&mut self)
fn gen_texture_mipmaps(&mut self)
Generates GPU mipmaps for a texture
.
Sourcefn set_texture_filter(&self, _: &RaylibThread, filter_mode: TextureFilter)
fn set_texture_filter(&self, _: &RaylibThread, filter_mode: TextureFilter)
Sets global texture
scaling filter mode.
Sourcefn set_texture_wrap(&self, _: &RaylibThread, wrap_mode: TextureWrap)
fn set_texture_wrap(&self, _: &RaylibThread, wrap_mode: TextureWrap)
Sets global texture wrapping mode.
fn is_texture_valid(&self) -> bool
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.