pub mod collections;
pub mod colormap;
mod colormesh;
pub mod hello;
pub mod ppi;
pub mod tools;
pub mod transforms;
pub mod ty;
use crate::{components::Program, errors::*};

pub use colormesh::ColorMesh;
use imgui::TextureId;

pub trait Graphics {
    fn draw(&mut self, gl: &glow::Context) -> Result<()>;

    fn compile(&mut self, gl: &glow::Context) -> Result<()>;

    fn destroy(&mut self, gl: &glow::Context) -> Result<()>;
}

pub trait AttaWithProgram {
    fn attach_with_program(&self, gl: &glow::Context, program: &Program) -> Result<()>;
}

pub trait AttaWithBuffer {
    type Data;
    fn attach_with_buffer(&mut self, gl: &glow::Context, data: &Self::Data) -> Result<()>;
}

pub trait AttaWithWindow {
    fn attach_with_window(&mut self, gl: &glow::Context) -> Result<TextureId>;
}
