Support Windows

This commit is contained in:
2025-07-11 22:07:04 +01:00
parent 1f2c3f4062
commit d04e52f9c2
2 changed files with 9 additions and 5 deletions
Generated
+4 -4
View File
@@ -3275,9 +3275,9 @@ dependencies = [
[[package]] [[package]]
name = "winnow" name = "winnow"
version = "0.7.11" version = "0.7.12"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74c7b26e3480b707944fc872477815d29a8e429d2f93a1ce000f5fa84a15cbcd" checksum = "f3edebf492c8125044983378ecb5766203ad3b4c2f7a922bd7dd207f6d443e95"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]
@@ -3356,9 +3356,9 @@ checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56"
[[package]] [[package]]
name = "xml-rs" name = "xml-rs"
version = "0.8.26" version = "0.8.27"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a62ce76d9b56901b19a74f19431b0d8b3bc7ca4ad685a746dfd78ca8f4fc6bda" checksum = "6fd8403733700263c6eb89f192880191f1b83e332f7a20371ddcf421c4a337c7"
[[package]] [[package]]
name = "xmlparser" name = "xmlparser"
+5 -1
View File
@@ -81,13 +81,14 @@ use vulkano::{
future::{FenceSignalFuture, NowFuture}, future::{FenceSignalFuture, NowFuture},
}, },
}; };
#[cfg(target_os = "linux")]
use winit::platform::x11::EventLoopBuilderExtX11;
use winit::{ use winit::{
application::ApplicationHandler, application::ApplicationHandler,
dpi::PhysicalSize, dpi::PhysicalSize,
event::{DeviceEvent, ElementState, MouseButton, WindowEvent}, event::{DeviceEvent, ElementState, MouseButton, WindowEvent},
event_loop::{ActiveEventLoop, EventLoop}, event_loop::{ActiveEventLoop, EventLoop},
keyboard::{KeyCode, PhysicalKey}, keyboard::{KeyCode, PhysicalKey},
platform::x11::EventLoopBuilderExtX11,
window::Window, window::Window,
}; };
@@ -127,7 +128,10 @@ fn main() -> Result<(), impl Error> {
]) ])
.unwrap(); .unwrap();
#[cfg(target_os = "linux")]
let event_loop = EventLoop::builder().with_x11().build().unwrap(); let event_loop = EventLoop::builder().with_x11().build().unwrap();
#[cfg(target_os = "windows")]
let event_loop = EventLoop::builder().build().unwrap();
let mut app = App::new(&event_loop); let mut app = App::new(&event_loop);
event_loop.run_app(&mut app) event_loop.run_app(&mut app)