use Default to avoid breaking fallback main
This commit is contained in:
parent
f2b904b5f9
commit
187019a318
10
src/lib.rs
10
src/lib.rs
|
|
@ -1,6 +1,6 @@
|
|||
use std::error::Error;
|
||||
|
||||
use glam::{UVec2, Vec4};
|
||||
use glam::{UVec2, Vec4, vec4};
|
||||
|
||||
const DEPTH_FORMAT: wgpu::TextureFormat = wgpu::TextureFormat::Depth16Unorm;
|
||||
const OUTPUT_FORMAT: wgpu::TextureFormat = wgpu::TextureFormat::Bgra8UnormSrgb;
|
||||
|
|
@ -11,6 +11,14 @@ pub struct RedrawArgs {
|
|||
pub background: Vec4,
|
||||
}
|
||||
|
||||
impl Default for RedrawArgs {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
background: vec4(0.05, 0.20, 0.85, 1.00),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Gpu {
|
||||
device: wgpu::Device,
|
||||
queue: wgpu::Queue,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use PROJECT_NAME::{Core, RedrawArgs, init_gpu_inner};
|
||||
use glam::{uvec2, vec4};
|
||||
use glam::uvec2;
|
||||
use winit::{
|
||||
application::ApplicationHandler,
|
||||
event::WindowEvent,
|
||||
|
|
@ -36,9 +36,7 @@ impl MainWindow {
|
|||
WindowEvent::Resized(physical_size) => self
|
||||
.core
|
||||
.configure(uvec2(physical_size.width, physical_size.height)),
|
||||
WindowEvent::RedrawRequested => self.core.redraw(&RedrawArgs {
|
||||
background: vec4(0.05, 0.20, 0.85, 1.00),
|
||||
}),
|
||||
WindowEvent::RedrawRequested => self.core.redraw(&RedrawArgs::default()),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user