diff --git a/gb-vst/src/ui.rs b/gb-vst/src/ui.rs index 9be2fc0..a083715 100644 --- a/gb-vst/src/ui.rs +++ b/gb-vst/src/ui.rs @@ -31,6 +31,8 @@ impl Emulator { } const EXTRA_SCALE: usize = 3; +const S_WIDTH: usize = WIDTH * EXTRA_SCALE; +const S_HEIGHT: usize = HEIGHT * EXTRA_SCALE; impl Editor for Emulator { fn spawn( @@ -40,12 +42,25 @@ impl Editor for Emulator { ) -> Box { let fr_cloned = self.frame_receiver.clone(); let js_cloned = self.joypad_sender.clone(); + + let (size, scale) = if cfg!(target_os = "macos") { + ( + Size::new(S_WIDTH as f64, S_HEIGHT as f64), + baseview::WindowScalePolicy::SystemScaleFactor, + ) + } else { + ( + Size::new(WIDTH as f64, HEIGHT as f64), + baseview::WindowScalePolicy::ScaleFactor(EXTRA_SCALE as f64), + ) + }; + Window::open_parented( &parent, WindowOpenOptions { title: String::from("gb-emu"), - size: Size::new((WIDTH * EXTRA_SCALE) as f64, (HEIGHT * EXTRA_SCALE) as f64), - scale: baseview::WindowScalePolicy::SystemScaleFactor, + size, + scale, gl_config: None, }, |w| EmulatorWindow::new(w, fr_cloned, js_cloned), @@ -85,7 +100,10 @@ impl EmulatorWindow { frame_receiver: Arc, joypad_sender: Arc, ) -> Self { - let info = WindowInfo::from_logical_size(Size::new(WIDTH as f64, HEIGHT as f64), 1.); + let info = WindowInfo::from_logical_size( + Size::new(WIDTH as f64, HEIGHT as f64), + EXTRA_SCALE as f64, + ); let (pix, scale, scaled_buf) = init_pixbuf(info, window);