SENSORS
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
use gui::Ui;
|
||||
use winit::{
|
||||
application::ApplicationHandler,
|
||||
event::WindowEvent,
|
||||
@@ -9,7 +10,7 @@ use super::Client;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct App {
|
||||
client: Option<Client>,
|
||||
client: Option<(Client, Ui<Client>)>,
|
||||
}
|
||||
|
||||
impl App {
|
||||
@@ -25,12 +26,14 @@ impl ApplicationHandler for App {
|
||||
let window = event_loop
|
||||
.create_window(Window::default_attributes())
|
||||
.unwrap();
|
||||
let client = Client::new(window.into());
|
||||
self.client = Some(client);
|
||||
let (ui, ids) = Client::create_ui();
|
||||
let client = Client::new(window.into(), ids);
|
||||
self.client = Some((client, ui));
|
||||
}
|
||||
}
|
||||
|
||||
fn window_event(&mut self, event_loop: &ActiveEventLoop, _id: WindowId, event: WindowEvent) {
|
||||
self.client.as_mut().unwrap().event(event, event_loop);
|
||||
let (client, ui) = self.client.as_mut().unwrap();
|
||||
client.event(event, event_loop, ui);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user