This commit is contained in:
Victoria Fischer 2024-12-02 19:39:06 +01:00
parent 6cafdcfa45
commit e2e608048d
3 changed files with 2 additions and 14 deletions

View File

@ -54,15 +54,6 @@ impl Shader for ThinkingShader {
} }
} }
#[derive(Debug)]
struct GayBarberShader {}
impl Shader for GayBarberShader {
fn draw(&self, coords: &VirtualCoordinates, frame: usize) -> RGB8 {
Hsv::new_srgb((frame as u8).wrapping_add(coords.x).wrapping_add(coords.y), 255, sin8((frame % 128) as u8)).into_rgb8()
}
}
impl<T: Surface> IdleTask<T> { impl<T: Surface> IdleTask<T> {
pub fn new<S: Surfaces<Surface = T>>(surfaces: &mut S) -> Self { pub fn new<S: Surfaces<Surface = T>>(surfaces: &mut S) -> Self {
IdleTask { IdleTask {
@ -123,7 +114,7 @@ impl TestShader {
Self::SweepY => Self::SinX, Self::SweepY => Self::SinX,
Self::SinX => Self::SinY, Self::SinX => Self::SinY,
Self::SinY => Self::Metaballs, Self::SinY => Self::Metaballs,
Self::Metaballs => Self::RGB Self::Metaballs => Self::Red
} }
} }
} }

View File

@ -4,10 +4,7 @@ use crate::power::AsMilliwatts;
use crate::render::{PixelView, Sample, Shader, Surface, Surfaces, HardwarePixel}; use crate::render::{PixelView, Sample, Shader, Surface, Surfaces, HardwarePixel};
use crate::task::Task; use crate::task::Task;
use std::borrow::BorrowMut;
use std::fmt::Debug; use std::fmt::Debug;
use std::rc::Rc;
use std::cell::RefCell;
use std::io; use std::io;
use std::ops::IndexMut; use std::ops::IndexMut;

View File

@ -33,7 +33,7 @@ fn main() {
let mut animations = FixedSizeScheduler::new([ let mut animations = FixedSizeScheduler::new([
Box::new(animations::IdleTask::new(&mut surfaces)), Box::new(animations::IdleTask::new(&mut surfaces)),
Box::new(animations::TestPattern::new(surfaces.new_surface(&Rectangle::everything()).unwrap())), Box::new(animations::TestPattern::new(surfaces.new_surface(&Rectangle::everything()).unwrap())),
]; ]);
let mut renderer = FixedSizeScheduler::new([Box::new(Renderer::new(output, surfaces))]); let mut renderer = FixedSizeScheduler::new([Box::new(Renderer::new(output, surfaces))]);