diff options
| author | HampusM <hampus@hampusmat.com> | 2026-06-04 19:27:34 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-06-04 19:27:34 +0200 |
| commit | 370db2f2c4406f3373be9065cda8fcdb3929b693 (patch) | |
| tree | d196dfd100ed22b91bcd88e2dc7720cc788de642 /engine/src/windowing.rs | |
| parent | c5f04bc1ff1b96d3aa1f2e46693b0b2726167586 (diff) | |
Diffstat (limited to 'engine/src/windowing.rs')
| -rw-r--r-- | engine/src/windowing.rs | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/engine/src/windowing.rs b/engine/src/windowing.rs index bf29453..3163869 100644 --- a/engine/src/windowing.rs +++ b/engine/src/windowing.rs @@ -499,20 +499,21 @@ fn create_event_loop() -> Result<EventLoop<()>, EventLoopError> { let mut event_loop_builder = EventLoop::builder(); - #[cfg(any(x11_platform, wayland_platform))] - winit::platform::x11::EventLoopBuilderExtX11::with_any_thread( - &mut event_loop_builder, - true, - ); - - #[cfg(windows)] - winit::platform::windows::EventLoopBuilderExtWindows::with_any_thread( - &mut event_loop_builder, - true, - ); - - #[cfg(not(any(x11_platform, wayland_platform, windows)))] - compile_error!("Unsupported platform"); + cfg_select! { + target_os = "linux" => { + winit::platform::x11::EventLoopBuilderExtX11::with_any_thread( + &mut event_loop_builder, + true, + ); + } + windows => { + winit::platform::windows::EventLoopBuilderExtWindows::with_any_thread( + &mut event_loop_builder, + true, + ); + } + _ => { compile_error!("Unsupported platform") } + } event_loop_builder.build() } |
