From 6189f52bb2f618170c9233754e7ae565a92bfdc1 Mon Sep 17 00:00:00 2001 From: Malte Voos Date: Sun, 2 Apr 2023 13:06:57 +0200 Subject: fixup! make it run in the browser --- src/lib.rs | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index cbac12e..1f6c229 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,12 +9,9 @@ use wasm_bindgen::prelude::*; use winit::dpi::LogicalSize; use winit::event::Event; use winit::event_loop::EventLoop; -use winit::window::WindowBuilder; +use winit::window::Window; use winit_input_helper::WinitInputHelper; -// const WIDTH: usize = 256; -// const HEIGHT: usize = 256; - #[wasm_bindgen(start)] async fn start() -> Result<(), JsValue> { return run().await.map_err(|err| JsValue::from(err.to_string())); @@ -23,17 +20,7 @@ async fn start() -> Result<(), JsValue> { async fn run() -> anyhow::Result<()> { let event_loop = EventLoop::new(); - // let size = LogicalSize { - // width: WIDTH as f64, - // height: HEIGHT as f64, - // }; - - let window = WindowBuilder::new() - // .with_inner_size(size) - // .with_min_inner_size(size) - .build(&event_loop)?; - - let window = Rc::new(window); + let window = Rc::new(Window::new(&event_loop)?); #[cfg(target_arch = "wasm32")] { -- cgit 1.4.1