diff --git a/src/context.rs b/src/context.rs index a89f514..d772099 100644 --- a/src/context.rs +++ b/src/context.rs @@ -1,9 +1,7 @@ use parking_lot::ReentrantMutex; -use std::cell::RefCell; use std::ffi::CStr; use std::ops::Drop; use std::ptr; -use std::rc::Rc; use crate::io::Io; use crate::string::{ImStr, ImString}; diff --git a/src/image.rs b/src/image.rs index a829afd..a6cfaa0 100644 --- a/src/image.rs +++ b/src/image.rs @@ -1,4 +1,3 @@ -use std::collections::HashMap; use std::marker::PhantomData; use std::os::raw::c_void; @@ -185,38 +184,3 @@ impl<'ui> ImageButton<'ui> { } } } - -/// Generic texture mapping for use by renderers. -#[derive(Debug, Default)] -pub struct Textures { - textures: HashMap, - next: usize, -} - -impl Textures { - pub fn new() -> Self { - Textures { - textures: HashMap::new(), - next: 0, - } - } - - pub fn insert(&mut self, texture: T) -> TextureId { - let id = self.next; - self.textures.insert(id, texture); - self.next += 1; - TextureId::from(id) - } - - pub fn replace(&mut self, id: TextureId, texture: T) -> Option { - self.textures.insert(id.id(), texture) - } - - pub fn remove(&mut self, id: TextureId) -> Option { - self.textures.remove(&id.id()) - } - - pub fn get(&self, id: TextureId) -> Option<&T> { - self.textures.get(&id.id()) - } -} diff --git a/src/render/draw_data.rs b/src/render/draw_data.rs index c7e0adc..07b9a19 100644 --- a/src/render/draw_data.rs +++ b/src/render/draw_data.rs @@ -1,4 +1,3 @@ -use std::mem; use std::slice; use crate::internal::{RawCast, RawWrapper};