use crate::ecs::world::World;

pub trait Render {
    fn render_frame(
        &mut self,
        _world: &mut World,
        ui_output: Option<egui::FullOutput>,
        ui_primitives: Option<Vec<egui::ClippedPrimitive>>,
    ) -> Result<(), Box<dyn std::error::Error>>;

    fn resize_surface(&mut self, width: u32, height: u32)
    -> Result<(), Box<dyn std::error::Error>>;

    fn surface_size(&self) -> (u32, u32);

    fn configure_with_state(
        &mut self,
        _state: &mut dyn crate::run::State,
    ) -> Result<(), Box<dyn std::error::Error>> {
        Ok(())
    }

    fn update_with_state(
        &mut self,
        _state: &mut dyn crate::run::State,
        _world: &mut World,
    ) -> Result<(), Box<dyn std::error::Error>> {
        Ok(())
    }
}
