mod cache;
mod cleanup;
mod manager;
mod resource;
#[cfg(test)]
mod tests;
mod upload;
use crate::{RenderResources, RendererError, RendererResult};
use dear_imgui_rs::{
TextureId,
render::{SnapshotTextureId, TextureFeedback, TextureOp, TextureRequest, TextureUploadRect},
texture::{TextureFormat as ImGuiTextureFormat, TextureRect},
};
use std::collections::HashMap;
use wgpu::*;
pub(crate) use manager::WgpuTextureManager;
pub(crate) use resource::OwnedWgpuTexture;
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
#[repr(transparent)]
pub struct ExternalTextureId(TextureId);
impl ExternalTextureId {
pub(super) const fn new(texture_id: TextureId) -> Self {
Self(texture_id)
}
#[must_use]
pub const fn texture_id(self) -> TextureId {
self.0
}
}
impl From<ExternalTextureId> for TextureId {
fn from(texture: ExternalTextureId) -> Self {
texture.texture_id()
}
}