fix: changed the input type of the clear_color in the with_clear_color to impl Color

This commit is contained in:
lisk77 2025-04-26 20:12:01 +02:00
parent 3a4090a6ec
commit 2a36d36493

View file

@ -1,31 +1,20 @@
use std::any::{type_name, Any}; use std::any::{type_name, Any};
use std::sync::{Arc, Mutex, RwLock}; use std::sync::{Arc, RwLock};
use std::sync::atomic::AtomicBool; use comet_ecs::{Camera2D, Component, Entity, Render2D, Scene, Transform2D, Transform3D};
use std::thread;
use std::time::{Duration, Instant};
use crossbeam_channel::bounded;
use comet_ecs::{Camera2D, Component, Entity, Render, Render2D, Scene, Transform2D, Transform3D};
use comet_resources::{ResourceManager, Vertex};
use comet_renderer::renderer2d::Renderer2D;
use winit::{ use winit::{
event::{self, *}, event::*,
event_loop::{self, EventLoop, EventLoopWindowTarget}, event_loop::{EventLoop, EventLoopWindowTarget},
keyboard::{KeyCode, PhysicalKey}, keyboard::{KeyCode, PhysicalKey},
window::{Icon, Window}, window::{Icon, Window},
}; };
use comet_colors::LinearRgba; use comet_colors::{Color, LinearRgba};
use comet_ecs::math::p3;
use comet_log::*; use comet_log::*;
use winit::dpi::{LogicalSize, PhysicalSize}; use winit::dpi::LogicalSize;
use winit::event_loop::ControlFlow;
use winit::window::Fullscreen;
use winit_input_helper::WinitInputHelper as InputManager; use winit_input_helper::WinitInputHelper as InputManager;
use comet_input::input_handler::InputHandler;
use comet_input::keyboard::Key; use comet_input::keyboard::Key;
use comet_renderer::renderer::Renderer; use comet_renderer::renderer::Renderer;
use comet_structs::ComponentSet; use comet_structs::ComponentSet;
use crate::GameState;
pub enum ApplicationType { pub enum ApplicationType {
App2D, App2D,
@ -78,8 +67,8 @@ impl App {
self self
} }
pub fn with_clear_color(mut self, clear_color: LinearRgba) -> Self { pub fn with_clear_color(mut self, clear_color: impl Color) -> Self {
self.clear_color = Some(clear_color); self.clear_color = Some(clear_color.to_linear());
self self
} }