red underlines

This commit is contained in:
Quaternions 2023-10-23 18:46:59 -07:00
parent c4ad4fbdf9
commit 03a4a60db2

View File

@ -11,8 +11,8 @@ pub enum RunInstruction{
pub struct RunState{ pub struct RunState{
manual_mouse_lock:bool, manual_mouse_lock:bool,
mouse:std::sync::Arc<std::sync::Mutex<physics::MouseState>>, mouse:std::sync::Arc<std::sync::Mutex<crate::physics::MouseState>>,
user_settings:settings::UserSettings, user_settings:crate::settings::UserSettings,
//Ideally the graphics thread worker description is: //Ideally the graphics thread worker description is:
/* /*
WorkerDescription{ WorkerDescription{
@ -21,14 +21,14 @@ pub struct RunState{
} }
*/ */
//up to three frames in flight, dropping new frame requests when all three are busy, and dropping output frames when one renders out of order //up to three frames in flight, dropping new frame requests when all three are busy, and dropping output frames when one renders out of order
graphics_thread:worker::INWorker<graphics::GraphicsInstruction>, graphics_thread:crate::worker::INWorker<crate::graphics::GraphicsInstruction>,
physics_thread:worker::QNWorker<TimedInstruction<InputInstruction>>, physics_thread:crate::worker::QNWorker<TimedInstruction<InputInstruction>>,
} }
impl RunState { impl RunState {
fn init() -> Self { fn init() -> Self {
//wee //wee
let user_settings=settings::read_user_settings(); let user_settings=crate::settings::read_user_settings();
let mut graphics=GraphicsState::new(); let mut graphics=GraphicsState::new();
@ -44,7 +44,7 @@ impl RunState {
//3. forget //3. forget
let mut state=RunState{ let mut state=Self{
manual_mouse_lock:false, manual_mouse_lock:false,
mouse:physics::MouseState::default(), mouse:physics::MouseState::default(),
user_settings, user_settings,
@ -61,7 +61,7 @@ impl RunState {
return state; return state;
} }
fn window_event(&mut self, window: &winit::window::Window, event: winit::event::WindowEvent) { fn window_event(&mut self, time:crate::integer::Time, event: winit::event::WindowEvent) {
match event { match event {
winit::event::WindowEvent::DroppedFile(path)=>{ winit::event::WindowEvent::DroppedFile(path)=>{
std::thread::spawn(move ||{ std::thread::spawn(move ||{
@ -156,7 +156,7 @@ impl RunState {
} }
} }
fn device_event(&mut self, window: &winit::window::Window, event: winit::event::DeviceEvent) { fn device_event(&mut self, time:crate::integer::Time, event: winit::event::DeviceEvent) {
match event { match event {
winit::event::DeviceEvent::MouseMotion { winit::event::DeviceEvent::MouseMotion {
delta,//these (f64,f64) are integers on my machine delta,//these (f64,f64) are integers on my machine
@ -196,10 +196,10 @@ impl RunState {
crate::worker::QNWorker::new(move |ins:TimedInstruction<RunInstruction>|{ crate::worker::QNWorker::new(move |ins:TimedInstruction<RunInstruction>|{
match ins.instruction{ match ins.instruction{
RunInstruction::WindowEvent(window_event)=>{ RunInstruction::WindowEvent(window_event)=>{
self.window_event(window_event); self.window_event(ins.time,window_event);
}, },
RunInstruction::DeviceEvent(device_event)=>{ RunInstruction::DeviceEvent(device_event)=>{
self.device_event(device_event); self.device_event(ins.time,device_event);
}, },
RunInstruction::Resize(size)=>{ RunInstruction::Resize(size)=>{
graphics_context.config.width=size.width.max(1); graphics_context.config.width=size.width.max(1);