Add `TexturePoll::texture_id`
This commit is contained in:
parent
4060d02f27
commit
25903d0a02
|
|
@ -439,12 +439,20 @@ pub enum TexturePoll {
|
||||||
|
|
||||||
impl TexturePoll {
|
impl TexturePoll {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn size(self) -> Option<Vec2> {
|
pub fn size(&self) -> Option<Vec2> {
|
||||||
match self {
|
match self {
|
||||||
TexturePoll::Pending { size } => size,
|
TexturePoll::Pending { size } => *size,
|
||||||
TexturePoll::Ready { texture } => Some(texture.size),
|
TexturePoll::Ready { texture } => Some(texture.size),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
pub fn texture_id(&self) -> Option<TextureId> {
|
||||||
|
match self {
|
||||||
|
TexturePoll::Pending { .. } => None,
|
||||||
|
TexturePoll::Ready { texture } => Some(texture.id),
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type TextureLoadResult = Result<TexturePoll>;
|
pub type TextureLoadResult = Result<TexturePoll>;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue