pub struct Texture { /* private fields */ }Expand description
Represents a texture.
Implementations§
Source§impl Texture
impl Texture
Sourcepub fn from_path<P>(
context: &mut TextureContext,
path: P,
settings: &TextureSettings,
) -> Result<Self, TextureError>
pub fn from_path<P>( context: &mut TextureContext, path: P, settings: &TextureSettings, ) -> Result<Self, TextureError>
Creates a Texture with image loading from path.
Sourcepub fn from_image(
context: &mut TextureContext,
img: &RgbaImage,
settings: &TextureSettings,
) -> Result<Self, TextureError>
pub fn from_image( context: &mut TextureContext, img: &RgbaImage, settings: &TextureSettings, ) -> Result<Self, TextureError>
Creates a Texture with img.
Trait Implementations§
Source§impl CreateTexture<TextureContext> for Texture
impl CreateTexture<TextureContext> for Texture
Source§fn create<S: Into<[u32; 2]>>(
_: &mut TextureContext,
_format: Format,
memory: &[u8],
size: S,
settings: &TextureSettings,
) -> Result<Self, TextureError>
fn create<S: Into<[u32; 2]>>( _: &mut TextureContext, _format: Format, memory: &[u8], size: S, settings: &TextureSettings, ) -> Result<Self, TextureError>
Create texture from memory.
Source§impl TextureOp<TextureContext> for Texture
impl TextureOp<TextureContext> for Texture
Source§type Error = TextureError
type Error = TextureError
The error when performing an operation.
Source§impl UpdateTexture<TextureContext> for Texture
impl UpdateTexture<TextureContext> for Texture
impl Eq for Texture
impl StructuralPartialEq for Texture
Auto Trait Implementations§
impl Freeze for Texture
impl !RefUnwindSafe for Texture
impl Send for Texture
impl Sync for Texture
impl Unpin for Texture
impl !UnwindSafe for Texture
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more