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