fix(main): Allow emu to work on windows and linux
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Rekai Nyangadzayi Musuka 2021-07-16 21:07:00 -05:00
parent 1d8fb8d32a
commit b4b84d0cc5
1 changed files with 17 additions and 1 deletions

View File

@ -140,6 +140,7 @@ fn main() -> Result<()> {
}); });
} }
#[cfg(not(windows))]
fn create_window(event_loop: &EventLoop<()>, title: &str) -> Result<Window> { fn create_window(event_loop: &EventLoop<()>, title: &str) -> Result<Window> {
let size = LogicalSize::new((GB_WIDTH as f64) * SCALE, (GB_HEIGHT as f64) * SCALE); let size = LogicalSize::new((GB_WIDTH as f64) * SCALE, (GB_HEIGHT as f64) * SCALE);
Ok(WindowBuilder::new() Ok(WindowBuilder::new()
@ -149,6 +150,21 @@ fn create_window(event_loop: &EventLoop<()>, title: &str) -> Result<Window> {
.with_resizable(true) .with_resizable(true)
.with_decorations(true) .with_decorations(true)
.with_transparent(false) .with_transparent(false)
// .with_drag_and_drop(false) // OleInitialize failed error if this is set to true .build(event_loop)?)
}
#[cfg(windows)]
fn create_window(event_loop: &EventLoop<()>, title: &str) -> Result<Window> {
use winit::platform::windows::WindowBuilderExtWindows;
let size = LogicalSize::new((GB_WIDTH as f64) * SCALE, (GB_HEIGHT as f64) * SCALE);
Ok(WindowBuilder::new()
.with_title(title)
.with_inner_size(size)
.with_min_inner_size(size)
.with_resizable(true)
.with_decorations(true)
.with_transparent(false)
.with_drag_and_drop(false)
.build(event_loop)?) .build(event_loop)?)
} }