diff --git a/crates/renderer/src/drivers/metal.rs b/crates/renderer/src/drivers/metal.rs index 531c0f1a8..c283299ac 100644 --- a/crates/renderer/src/drivers/metal.rs +++ b/crates/renderer/src/drivers/metal.rs @@ -21,7 +21,6 @@ pub struct MetalDriver { pub(crate) gr_context: DirectContext, pub(crate) metal_layer: MetalLayer, pub(crate) command_queue: CommandQueue, - pub(crate) scale_factor: f64, } impl MetalDriver { @@ -101,7 +100,6 @@ impl MetalDriver { gr_context, metal_layer, command_queue, - scale_factor, }; (driver, window, skia_surface) diff --git a/crates/renderer/src/drivers/mod.rs b/crates/renderer/src/drivers/mod.rs index 2ea972ec1..261d9f1fe 100644 --- a/crates/renderer/src/drivers/mod.rs +++ b/crates/renderer/src/drivers/mod.rs @@ -6,7 +6,6 @@ pub use metal::*; use freya_engine::prelude::Surface as SkiaSurface; use glutin::surface::GlSurface; -use metal::MetalDriver; use winit::{ dpi::PhysicalSize, event_loop::ActiveEventLoop, @@ -26,8 +25,14 @@ impl GraphicsDriver { window_attributes: WindowAttributes, config: &LaunchConfig, ) -> (Self, Window, SkiaSurface) { - let (driver, window, surface) = OpenGLDriver::new(event_loop, window_attributes, config); - (Self::OpenGl(driver), window, surface) + if cfg!(not(target_os = "macos")) { + let (driver, window, surface) = + OpenGLDriver::new(event_loop, window_attributes, config); + (Self::OpenGl(driver), window, surface) + } else { + let (driver, window, surface) = MetalDriver::new(event_loop, window_attributes, config); + (Self::Metal(driver), window, surface) + } } pub fn make_current(&mut self) {