mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 04:33:37 +00:00
Merge pull request #73 from Moxinilian/windows-winit-panic
winit: fix panic on windows
This commit is contained in:
commit
fb9f04ba90
1 changed files with 11 additions and 0 deletions
|
@ -14,7 +14,18 @@ impl WinitWindows {
|
||||||
event_loop: &winit::event_loop::EventLoopWindowTarget<()>,
|
event_loop: &winit::event_loop::EventLoopWindowTarget<()>,
|
||||||
window: &Window,
|
window: &Window,
|
||||||
) {
|
) {
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
let winit_window = {
|
||||||
|
use winit::platform::windows::WindowBuilderExtWindows;
|
||||||
|
winit::window::WindowBuilder::new()
|
||||||
|
.with_drag_and_drop(false)
|
||||||
|
.build(&event_loop)
|
||||||
|
.unwrap()
|
||||||
|
};
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "windows"))]
|
||||||
let winit_window = winit::window::Window::new(&event_loop).unwrap();
|
let winit_window = winit::window::Window::new(&event_loop).unwrap();
|
||||||
|
|
||||||
self.window_id_to_winit.insert(window.id, winit_window.id());
|
self.window_id_to_winit.insert(window.id, winit_window.id());
|
||||||
self.winit_to_window_id.insert(winit_window.id(), window.id);
|
self.winit_to_window_id.insert(winit_window.id(), window.id);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue