dear_imgui_wgpu/
texture.rs1mod cache;
8mod cleanup;
9mod manager;
10mod resource;
11#[cfg(test)]
12mod tests;
13mod upload;
14
15use crate::{RenderResources, RendererError, RendererResult};
16use dear_imgui_rs::{
17 TextureId,
18 render::{SnapshotTextureId, TextureFeedback, TextureOp, TextureRequest, TextureUploadRect},
19 texture::{TextureFormat as ImGuiTextureFormat, TextureRect},
20};
21use std::collections::HashMap;
22use wgpu::*;
23
24pub(crate) use manager::WgpuTextureManager;
25pub(crate) use resource::OwnedWgpuTexture;
26
27#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
34#[repr(transparent)]
35pub struct ExternalTextureId(TextureId);
36
37impl ExternalTextureId {
38 pub(super) const fn new(texture_id: TextureId) -> Self {
39 Self(texture_id)
40 }
41
42 #[must_use]
44 pub const fn texture_id(self) -> TextureId {
45 self.0
46 }
47}
48
49impl From<ExternalTextureId> for TextureId {
50 fn from(texture: ExternalTextureId) -> Self {
51 texture.texture_id()
52 }
53}