pub type TextureResource = Resource<Texture>;Expand description
Type alias for texture resources.
Aliased Type§
pub struct TextureResource { /* private fields */ }Trait Implementations§
Source§impl TextureResourceExtension for TextureResource
impl TextureResourceExtension for TextureResource
Source§fn new_render_target(width: u32, height: u32) -> Self
fn new_render_target(width: u32, height: u32) -> Self
Creates new render target for a scene. This method automatically configures GPU texture
to correct settings, after render target was created, it must not be modified, otherwise
result is undefined.
Source§fn load_from_memory(
kind: ResourceKind,
data: &[u8],
import_options: TextureImportOptions,
) -> Result<Self, TextureError>
fn load_from_memory( kind: ResourceKind, data: &[u8], import_options: TextureImportOptions, ) -> Result<Self, TextureError>
Tries to load a texture from given data. Use this method if you want to
load a texture from embedded data. Read more
Source§fn from_bytes(
kind: TextureKind,
pixel_kind: TexturePixelKind,
bytes: Vec<u8>,
resource_kind: ResourceKind,
) -> Option<Self>
fn from_bytes( kind: TextureKind, pixel_kind: TexturePixelKind, bytes: Vec<u8>, resource_kind: ResourceKind, ) -> Option<Self>
Tries to create new texture from given parameters, it may fail only if size of data passed
in does not match with required.
Source§fn deep_clone(&self) -> Self
fn deep_clone(&self) -> Self
Creates a deep clone of the texture. Unlike
TextureResource::clone, this method clones the actual texture data,
which could be slow.