From 7e90dd5a2219687de3752dee1666345f164107a8 Mon Sep 17 00:00:00 2001 From: Victoria Fischer Date: Sat, 2 Nov 2024 15:22:49 +0100 Subject: [PATCH] animations: set blank shaders on task start --- src/animations.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/animations.rs b/src/animations.rs index ba687d8..78c1f93 100644 --- a/src/animations.rs +++ b/src/animations.rs @@ -37,7 +37,9 @@ impl IdleTask { } impl Task for IdleTask { - fn name(&self) -> &'static str { "Idle" } + fn start(&mut self) { + self.surface.set_shader(Box::new(IdleShader { frame: self.frame })); + } fn tick(&mut self) { self.updater.run(|| { @@ -114,7 +116,9 @@ impl TestPattern { } impl Task for TestPattern { - fn name(&self) -> &'static str { "Idle" } + fn start(&mut self) { + self.surface.set_shader(Box::new(TestShader { pattern: self.pattern })); + } fn tick(&mut self) { self.updater.run(|| {