diff options
Diffstat (limited to 'Common/NativeApp')
4 files changed, 7 insertions, 6 deletions
diff --git a/Common/NativeApp/Apple/Data/OSX/Base.lproj/Main.storyboard b/Common/NativeApp/Apple/Data/OSX/Base.lproj/Main.storyboard index 0b43f5c..7d318c2 100644 --- a/Common/NativeApp/Apple/Data/OSX/Base.lproj/Main.storyboard +++ b/Common/NativeApp/Apple/Data/OSX/Base.lproj/Main.storyboard @@ -137,7 +137,7 @@ </connections> </window> <connections> - <segue destination="XfG-lQ-9wD" kind="relationship" relationship="window.shadowedContentViewController" id="XQd-qx-IMN"/> + <segue destination="VWH-wR-9QD" kind="relationship" relationship="window.shadowedContentViewController" id="emZ-jG-HLe"/> </connections> </windowController> <customObject id="Oky-zY-oP4" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/> diff --git a/Common/NativeApp/Apple/Source/Classes/OSX/MTKRenderer.h b/Common/NativeApp/Apple/Source/Classes/OSX/MTKRenderer.h index d62dc81..50f4eb0 100644 --- a/Common/NativeApp/Apple/Source/Classes/OSX/MTKRenderer.h +++ b/Common/NativeApp/Apple/Source/Classes/OSX/MTKRenderer.h @@ -29,7 +29,7 @@ @interface MTKRenderer : NSObject<MTKViewDelegate> - (nonnull instancetype)initWithMetalKitView:(nonnull MTKView *)mtkView; -- (NativeAppBase*)getApp; +- (NativeAppBase* _Nullable)getApp; @end diff --git a/Common/NativeApp/Apple/Source/Classes/OSX/MTKRenderer.mm b/Common/NativeApp/Apple/Source/Classes/OSX/MTKRenderer.mm index 75500b6..78a82ba 100644 --- a/Common/NativeApp/Apple/Source/Classes/OSX/MTKRenderer.mm +++ b/Common/NativeApp/Apple/Source/Classes/OSX/MTKRenderer.mm @@ -48,10 +48,7 @@ /// Called whenever view changes orientation or is resized - (void)mtkView:(nonnull MTKView *)view drawableSizeWillChange:(CGSize)size { - NSRect viewRectPoints = [view bounds]; - NSRect viewRectPixels = [view convertRectToBacking:viewRectPoints]; - - _theApp->WindowResize(viewRectPixels.size.width, viewRectPixels.size.height); + _theApp->WindowResize(size.width, size.height); } /// Called whenever the view needs to render a frame diff --git a/Common/NativeApp/Apple/Source/Classes/OSX/MetalViewController.mm b/Common/NativeApp/Apple/Source/Classes/OSX/MetalViewController.mm index 985f442..5e5f563 100644 --- a/Common/NativeApp/Apple/Source/Classes/OSX/MetalViewController.mm +++ b/Common/NativeApp/Apple/Source/Classes/OSX/MetalViewController.mm @@ -36,6 +36,10 @@ [super viewDidLoad]; _view = (MTKView *)self.view; + NSScreen* screen = [NSScreen mainScreen]; + auto scaleFactor = [screen backingScaleFactor]; + auto layer = [_view layer]; + layer.contentsScale = scaleFactor; _renderer = [[MTKRenderer alloc] initWithMetalKitView:_view]; _theApp = [_renderer getApp]; |
