Struct amethyst_renderer::Texture [−][src]
pub struct Texture { /* fields omitted */ }Handle to a GPU texture resource.
Methods
impl Texture[src]
impl Texturepub fn from_data<T: Pod + Copy, D: AsRef<[T]>>(data: D) -> TextureBuilder<D, T>[src]
pub fn from_data<T: Pod + Copy, D: AsRef<[T]>>(data: D) -> TextureBuilder<D, T>Builds a new texture with the given raw texture data.
pub fn from_color_val<C: Into<[f32; 4]>>(rgba: C) -> TextureBuilder<[u8; 4], u8>[src]
pub fn from_color_val<C: Into<[f32; 4]>>(rgba: C) -> TextureBuilder<[u8; 4], u8>Builds a new texture with the given raw texture data.
pub fn sampler(&self) -> &Sampler<Resources>[src]
pub fn sampler(&self) -> &Sampler<Resources>Returns the sampler for the texture.
pub fn view(&self) -> &RawShaderResourceView<Resources>[src]
pub fn view(&self) -> &RawShaderResourceView<Resources>Returns the texture's raw shader resource view.
Trait Implementations
impl SimpleFormat<Texture> for JpgFormat[src]
impl SimpleFormat<Texture> for JpgFormatconst NAME: &'static str
NAME: &'static str = "JPEG"
A unique identifier for this format.
type Options = TextureMetadata
Options specific to the format, which are passed to import. E.g. for textures this would be stuff like mipmap levels and sampler info. Read more
fn import(
&self,
bytes: Vec<u8>,
options: TextureMetadata
) -> Result<TextureData>[src]
fn import(
&self,
bytes: Vec<u8>,
options: TextureMetadata
) -> Result<TextureData>Produces asset data from given bytes.
impl SimpleFormat<Texture> for PngFormat[src]
impl SimpleFormat<Texture> for PngFormatconst NAME: &'static str
NAME: &'static str = "PNG"
A unique identifier for this format.
type Options = TextureMetadata
Options specific to the format, which are passed to import. E.g. for textures this would be stuff like mipmap levels and sampler info. Read more
fn import(
&self,
bytes: Vec<u8>,
options: TextureMetadata
) -> Result<TextureData>[src]
fn import(
&self,
bytes: Vec<u8>,
options: TextureMetadata
) -> Result<TextureData>Produces asset data from given bytes.
impl SimpleFormat<Texture> for BmpFormat[src]
impl SimpleFormat<Texture> for BmpFormatconst NAME: &'static str
NAME: &'static str = "BMP"
A unique identifier for this format.
type Options = TextureMetadata
Options specific to the format, which are passed to import. E.g. for textures this would be stuff like mipmap levels and sampler info. Read more
fn import(
&self,
bytes: Vec<u8>,
options: TextureMetadata
) -> Result<TextureData>[src]
fn import(
&self,
bytes: Vec<u8>,
options: TextureMetadata
) -> Result<TextureData>Produces asset data from given bytes.
impl Clone for Texture[src]
impl Clone for Texturefn clone(&self) -> Texture[src]
fn clone(&self) -> TextureReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Debug for Texture[src]
impl Debug for Texturefn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Eq for Texture[src]
impl Eq for Textureimpl Hash for Texture[src]
impl Hash for Texturefn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash<__H: Hasher>(&self, state: &mut __H)Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl PartialEq for Texture[src]
impl PartialEq for Texturefn eq(&self, other: &Texture) -> bool[src]
fn eq(&self, other: &Texture) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Texture) -> bool[src]
fn ne(&self, other: &Texture) -> boolThis method tests for !=.
impl Asset for Texture[src]
impl Asset for Textureconst NAME: &'static str
NAME: &'static str = "renderer::Texture"
An identifier for this asset used for debugging.
type Data = TextureData
The Data type the asset can be created from.
type HandleStorage = DenseVecStorage<TextureHandle>
The ECS storage type to be used. You'll want to use VecStorage in most cases.