feat: added Color trait to the comet_colors crate to make parameters simpler

This commit is contained in:
lisk77 2025-03-18 16:52:49 +01:00
parent b2578f7673
commit 7dc17fb435
13 changed files with 100 additions and 132 deletions

View file

@ -1,10 +1,10 @@
use std::sync::Arc;
use winit::dpi::PhysicalSize;
use winit::window::Window;
use comet_colors::LinearRgba;
use comet_colors::Color;
pub trait Renderer: Sized + Send + Sync {
async fn new(window: Arc<Window>, clear_color: Option<LinearRgba>) -> Self;
async fn new(window: Arc<Window>, clear_color: Option<impl Color>) -> Self;
fn size(&self) -> PhysicalSize<u32>;
fn resize(&mut self, new_size: winit::dpi::PhysicalSize<u32>);
fn update(&mut self) -> f32;