Automatically hide the cursor when the spotlight is activated
parent
49d8745374
commit
9a03b4a36c
|
@ -101,7 +101,9 @@ impl Spotlight {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update(&mut self) {}
|
pub fn update(&mut self, window: &winit::window::Window) {
|
||||||
|
window.set_cursor_visible(!self.is_ctrl_pressed);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
|
|
|
@ -233,10 +233,6 @@ impl<'a> State<'a> {
|
||||||
if char == "r" {
|
if char == "r" {
|
||||||
self.camera_controller.reset_camera(&mut self.camera);
|
self.camera_controller.reset_camera(&mut self.camera);
|
||||||
}
|
}
|
||||||
else if char == "h" {
|
|
||||||
self.hide_cursor = !self.hide_cursor;
|
|
||||||
self.window.set_cursor_visible(!self.hide_cursor);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -256,7 +252,7 @@ impl<'a> State<'a> {
|
||||||
bytemuck::cast_slice(&[self.camera_info.uniform]),
|
bytemuck::cast_slice(&[self.camera_info.uniform]),
|
||||||
);
|
);
|
||||||
|
|
||||||
self.spotlight.update();
|
self.spotlight.update(&self.window);
|
||||||
self.spotlight_info
|
self.spotlight_info
|
||||||
.uniform
|
.uniform
|
||||||
.update(&self.spotlight, &self.camera_controller);
|
.update(&self.spotlight, &self.camera_controller);
|
||||||
|
|
Loading…
Reference in New Issue