summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalte Voos <git@mal.tc>2023-04-02 13:06:57 +0200
committerMalte Voos <git@mal.tc>2023-04-02 13:06:57 +0200
commit6189f52bb2f618170c9233754e7ae565a92bfdc1 (patch)
tree090b79c28c63e57d8eb6256c70bf9af803c0d4b0
parent58b1fced2563f40990123ab362b0df53b5a91c0e (diff)
downloadlife-6189f52bb2f618170c9233754e7ae565a92bfdc1.tar.gz
life-6189f52bb2f618170c9233754e7ae565a92bfdc1.zip
fixup! make it run in the browser
-rw-r--r--src/lib.rs17
1 files 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")]
{