use super::OutputLayer;

pub struct ConstantBrightness {
    pub brightness: f32,
}

impl OutputLayer for ConstantBrightness {
    fn tick(&mut self, _dt: std::time::Duration) {}

    fn draw_sdl(
        &self,
        _canvas: &mut sdl2::render::Canvas<sdl2::video::Window>,
        _texture_size: u32,
    ) {
    }

    fn on_sdl_event(&mut self, _event: &sdl2::event::Event) {}

    fn update_dmx(&self, output: &mut [crate::fixtures::MovingHead; 4]) {
        for head in output.iter_mut() {
            head.dimmer = self.brightness;
        }
    }
}
