From 488b307cc33be0f10a8f6cab80eb30d3b2b89430 Mon Sep 17 00:00:00 2001 From: Michael Sippel Date: Fri, 8 Nov 2024 20:12:38 +0100 Subject: [PATCH] update winit --- Cargo.toml | 2 +- src/main.rs | 8 ++++++-- src/patterns/alternate.rs | 1 - src/patterns/arctic_rain.rs | 1 - src/patterns/breathing.rs | 1 - src/patterns/gastel_fade.rs | 1 - src/patterns/oneshotman.rs | 1 - src/patterns/pastel_fade.rs | 1 - src/patterns/strobe.rs | 1 - src/patterns/uboot_prüfstand_fade.rs | 1 - src/patterns/wave_fade.rs | 1 - src/patterns/wheel.rs | 1 - src/scene_library.rs | 1 - 13 files changed, 7 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 931cc04..9aeec24 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" [dependencies] winit = "*" -softbuffer = "0.4.2" +softbuffer = "0.4.6" cgmath = "*" prisma = "0.1.1" angular-units = "*" diff --git a/src/main.rs b/src/main.rs index ace902d..6b2fd4e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,7 +6,6 @@ use { std::rc::Rc, winit::event::{Event, WindowEvent}, winit::event_loop::{ControlFlow, EventLoop}, - winit::window::WindowBuilder, prisma::{Rgb,Hsv,FromColor, Lerp}, cgmath::{Point2, Vector2}, std::time::Duration, @@ -42,7 +41,12 @@ use crate::{ #[async_std::main] async fn main() { let event_loop = EventLoop::new().unwrap(); - let window = Arc::new(WindowBuilder::new().build(&event_loop).unwrap()); + + let window = event_loop.create_window( + winit::window::Window::default_attributes() + .with_title("Fragmental Light Controller") + ).expect("create window"); + let window = Arc::new(window); let context = softbuffer::Context::new(window.clone()).unwrap(); let mut surface = Arc::new(Mutex::new(softbuffer::Surface::new(&context, window.clone()).unwrap())); diff --git a/src/patterns/alternate.rs b/src/patterns/alternate.rs index 1dc04d2..5fb4499 100644 --- a/src/patterns/alternate.rs +++ b/src/patterns/alternate.rs @@ -4,7 +4,6 @@ use { std::rc::Rc, winit::event::{Event, WindowEvent}, winit::event_loop::{ControlFlow, EventLoop}, - winit::window::WindowBuilder, prisma::{Rgb,Hsv,FromColor, Lerp}, cgmath::{Point2, Vector2}, std::time::Duration, diff --git a/src/patterns/arctic_rain.rs b/src/patterns/arctic_rain.rs index dc1945f..c8e760c 100644 --- a/src/patterns/arctic_rain.rs +++ b/src/patterns/arctic_rain.rs @@ -4,7 +4,6 @@ use { std::rc::Rc, winit::event::{Event, WindowEvent}, winit::event_loop::{ControlFlow, EventLoop}, - winit::window::WindowBuilder, prisma::{Rgb,Hsv,FromColor, Lerp}, cgmath::{Point2, Vector2}, std::time::Duration, diff --git a/src/patterns/breathing.rs b/src/patterns/breathing.rs index 900c97c..89505b6 100644 --- a/src/patterns/breathing.rs +++ b/src/patterns/breathing.rs @@ -4,7 +4,6 @@ use { std::rc::Rc, winit::event::{Event, WindowEvent}, winit::event_loop::{ControlFlow, EventLoop}, - winit::window::WindowBuilder, prisma::{Rgb,Hsv,FromColor, Lerp}, cgmath::{Point2, Vector2}, std::time::Duration, diff --git a/src/patterns/gastel_fade.rs b/src/patterns/gastel_fade.rs index a5fcd3d..0fa3f6d 100644 --- a/src/patterns/gastel_fade.rs +++ b/src/patterns/gastel_fade.rs @@ -4,7 +4,6 @@ use { std::rc::Rc, winit::event::{Event, WindowEvent}, winit::event_loop::{ControlFlow, EventLoop}, - winit::window::WindowBuilder, prisma::{Rgb,Hsv,FromColor, Lerp}, cgmath::{Point2, Vector2}, std::time::Duration, diff --git a/src/patterns/oneshotman.rs b/src/patterns/oneshotman.rs index 0f875a0..a0835ec 100644 --- a/src/patterns/oneshotman.rs +++ b/src/patterns/oneshotman.rs @@ -4,7 +4,6 @@ use { std::rc::Rc, winit::event::{Event, WindowEvent}, winit::event_loop::{ControlFlow, EventLoop}, - winit::window::WindowBuilder, prisma::{Rgb,Hsv,FromColor, Lerp}, cgmath::{Point2, Vector2}, std::time::Duration, diff --git a/src/patterns/pastel_fade.rs b/src/patterns/pastel_fade.rs index c9d7198..9b5f701 100644 --- a/src/patterns/pastel_fade.rs +++ b/src/patterns/pastel_fade.rs @@ -4,7 +4,6 @@ use { std::rc::Rc, winit::event::{Event, WindowEvent}, winit::event_loop::{ControlFlow, EventLoop}, - winit::window::WindowBuilder, prisma::{Rgb,Hsv,FromColor, Lerp}, cgmath::{Point2, Vector2}, std::time::Duration, diff --git a/src/patterns/strobe.rs b/src/patterns/strobe.rs index 1aa4dec..1fb8ebd 100644 --- a/src/patterns/strobe.rs +++ b/src/patterns/strobe.rs @@ -4,7 +4,6 @@ use { std::rc::Rc, winit::event::{Event, WindowEvent}, winit::event_loop::{ControlFlow, EventLoop}, - winit::window::WindowBuilder, prisma::{Rgb,Hsv,FromColor, Lerp}, cgmath::{Point2, Vector2}, std::time::Duration, diff --git a/src/patterns/uboot_prüfstand_fade.rs b/src/patterns/uboot_prüfstand_fade.rs index adb3650..6c7663d 100644 --- a/src/patterns/uboot_prüfstand_fade.rs +++ b/src/patterns/uboot_prüfstand_fade.rs @@ -4,7 +4,6 @@ use { std::rc::Rc, winit::event::{Event, WindowEvent}, winit::event_loop::{ControlFlow, EventLoop}, - winit::window::WindowBuilder, prisma::{Rgb,Hsv,FromColor, Lerp}, cgmath::{Point2, Vector2}, std::time::Duration, diff --git a/src/patterns/wave_fade.rs b/src/patterns/wave_fade.rs index d94339a..d5e62b4 100644 --- a/src/patterns/wave_fade.rs +++ b/src/patterns/wave_fade.rs @@ -4,7 +4,6 @@ use { std::rc::Rc, winit::event::{Event, WindowEvent}, winit::event_loop::{ControlFlow, EventLoop}, - winit::window::WindowBuilder, prisma::{Rgb,Hsv,FromColor, Lerp}, cgmath::{Point2, Vector2}, std::time::Duration, diff --git a/src/patterns/wheel.rs b/src/patterns/wheel.rs index 7231510..4829b67 100644 --- a/src/patterns/wheel.rs +++ b/src/patterns/wheel.rs @@ -4,7 +4,6 @@ use { std::rc::Rc, winit::event::{Event, WindowEvent}, winit::event_loop::{ControlFlow, EventLoop}, - winit::window::WindowBuilder, prisma::{Rgb,Hsv,FromColor, Lerp}, cgmath::{Point2, Vector2}, std::time::Duration, diff --git a/src/scene_library.rs b/src/scene_library.rs index 316e00b..509fe54 100644 --- a/src/scene_library.rs +++ b/src/scene_library.rs @@ -4,7 +4,6 @@ use { std::rc::Rc, winit::event::{Event, WindowEvent}, winit::event_loop::{ControlFlow, EventLoop}, - winit::window::WindowBuilder, prisma::{Rgb,Hsv,FromColor, Lerp}, cgmath::{Point2, Vector2}, std::time::Duration,