Skip to content

Commit

Permalink
Window handle
Browse files Browse the repository at this point in the history
  • Loading branch information
nanoqsh committed Oct 26, 2023
1 parent f81ea5c commit 59cb5cf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dunge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ glam = "0.24"
instant = "0.1"
log = "0.4"
wgpu = "0.18"
winit = { version = "0.29", default-features = false, features = ["rwh_06"] }
winit = { version = "0.29", default-features = false, features = ["rwh_05"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.2", features = ["js"] }
Expand Down
10 changes: 8 additions & 2 deletions dunge/src/canvas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,10 @@ pub(crate) mod window {
}
};

let event_loop = EventLoopBuilder::with_user_event().build();
let event_loop = EventLoopBuilder::with_user_event()
.build()
.expect("build event loop");

let window = builder.build(&event_loop).expect("build window");
window.set_cursor_visible(state.show_cursor);

Expand Down Expand Up @@ -403,7 +406,10 @@ pub(crate) mod window {
pub fn from_element(id: &str) -> Canvas {
use {web_sys::Window, winit::platform::web::WindowExtWebSys};

let event_loop = EventLoopBuilder::with_user_event().build();
let event_loop = EventLoopBuilder::with_user_event()
.build()
.expect("build event loop");

let window = WindowBuilder::new()
.build(&event_loop)
.expect("build window");
Expand Down

0 comments on commit 59cb5cf

Please sign in to comment.