mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 05:40:03 -04:00
Add TexturePoll::texture_id
This commit is contained in:
@@ -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>;
|
||||||
|
|||||||
Reference in New Issue
Block a user