mirror of
https://github.com/libretro/snes9x.git
synced 2024-12-04 07:11:02 +00:00
Mac: Make metal layer inherit content sale from window to fix issues swapping between retina and non-retina monitors
This commit is contained in:
parent
0a8972524d
commit
0a9d83654b
@ -55,7 +55,18 @@ typedef struct
|
||||
vector_float2 textureCoordinate;
|
||||
} MetalVertex;
|
||||
|
||||
@interface MetalLayerDelegate: NSObject<CALayerDelegate, NSViewLayerContentScaleDelegate>
|
||||
@end
|
||||
|
||||
@implementation MetalLayerDelegate
|
||||
- (BOOL)layer:(CALayer *)layer shouldInheritContentsScale:(CGFloat)newScale fromWindow:(NSWindow *)window
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
@end
|
||||
|
||||
CAMetalLayer *metalLayer = nil;
|
||||
MetalLayerDelegate *layerDelegate = nil;
|
||||
id<MTLDevice> metalDevice = nil;
|
||||
id<MTLTexture> metalTexture = nil;
|
||||
id<MTLCommandQueue> metalCommandQueue = nil;
|
||||
@ -147,6 +158,8 @@ static void S9xInitMetal (void)
|
||||
glScreenH = glScreenBounds.size.height;
|
||||
|
||||
metalLayer = (CAMetalLayer *)s9xView.layer;
|
||||
layerDelegate = [MetalLayerDelegate new];
|
||||
metalLayer.delegate = layerDelegate;
|
||||
|
||||
metalDevice = s9xView.device;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user