Skip to main content

TextureResource

Type Alias TextureResource 

Source
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

Source§

fn new_render_target(width: u32, height: u32) -> Self

Creates new render target. 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 new_cube_render_target(size: u32) -> Self

Creates a new cube map render target. This method automatically configures GPU texture to correct settings. After the render target was created, it must not be modified. Otherwise the result is undefined. Cube map contains six images
Source§

fn new_render_target_with_format( width: u32, height: u32, pixel_kind: TexturePixelKind, ) -> Self

Creates new render target with the specified pixel kind. 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( resource_uuid: Uuid, 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( resource_uuid: Uuid, 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

Creates a deep clone of the texture. Unlike TextureResource::clone, this method clones the actual texture data, which could be slow.