pub struct Texture2DRef {
pub texture: Arc<Texture2D>,
pub transformation: Mat3,
}
Expand description
A reference to a 2D texture and a texture transformation.
Fields§
§texture: Arc<Texture2D>
A reference to the texture.
transformation: Mat3
A transformation applied to the uv coordinates before reading a texel value at those uv coordinates. This is primarily used in relation to texture atlasing.
Implementations§
Source§impl Texture2DRef
impl Texture2DRef
Sourcepub fn from_cpu_texture(context: &Context, cpu_texture: &CpuTexture) -> Self
pub fn from_cpu_texture(context: &Context, cpu_texture: &CpuTexture) -> Self
Creates a new Texture2DRef with an identity transformation from a CpuTexture.
Sourcepub fn from_texture(texture: Texture2D) -> Self
pub fn from_texture(texture: Texture2D) -> Self
Creates a new Texture2DRef with an identity transformation from a Texture2D.
Trait Implementations§
Source§impl Clone for Texture2DRef
impl Clone for Texture2DRef
Source§fn clone(&self) -> Texture2DRef
fn clone(&self) -> Texture2DRef
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Deref for Texture2DRef
impl Deref for Texture2DRef
Auto Trait Implementations§
impl Freeze for Texture2DRef
impl RefUnwindSafe for Texture2DRef
impl Send for Texture2DRef
impl Sync for Texture2DRef
impl Unpin for Texture2DRef
impl UnwindSafe for Texture2DRef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more