
pub trait Handle {
    fn get_handle(&self) -> u32;
}

pub enum DrawableHandle {
    Texture(CanvasTextureHandle),
    Image(CanvasImageHandle),
    Font(CanvasFontHandle),
}

/// Typed wrapper for a u32 handle
#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)]
pub struct CanvasFontHandle {
    pub(in crate::canvas) handle: u32
}

impl Handle for CanvasFontHandle {
    fn get_handle(&self) -> u32 {
        self.handle
    }
}

/// Typed wrapper for a u32 handle
#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)]
pub struct CanvasTextureHandle {
    pub/*(in crate::canvas)*/ handle: u32
}

impl Handle for CanvasTextureHandle {
    fn get_handle(&self) -> u32 {
        self.handle
    }
}

/// Typed wrapper for a u32 handle
#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)]
pub struct CanvasImageHandle {
    pub(in crate::canvas) handle: u32
}

impl Handle for CanvasImageHandle {
    fn get_handle(&self) -> u32 {
        self.handle
    }
}

/// Typed wrapper for a u32 handle
#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)]
pub struct CompiledShaderHandle {
    pub(in crate::canvas) handle: u32
}

impl Handle for CompiledShaderHandle {
    fn get_handle(&self) -> u32 {
        self.handle
    }
}


