This repository has been archived on 2025-03-22. You can view files and clone it, but cannot push or open issues or pull requests.
organicmaps-tmp/iphone/Maps/Classes/MetalView.mm

35 lines
803 B
Text

#import "MetalView.h"
@implementation MetalView
// The Metal view is stored in the nib file. When it's unarchived it's sent -initWithCoder:
- (id)initWithCoder:(NSCoder *)coder
{
NSLog(@"MetalView initWithCoder Started");
self = [super initWithCoder:coder];
if (self)
[self initialize];
NSLog(@"MetalView initWithCoder Ended");
return self;
}
- (void)initialize
{
self.device = MTLCreateSystemDefaultDevice();
if (!self.device)
{
self.opaque = NO;
self.hidden = YES;
NSLog(@"Metal is not supported on this device");
return;
}
self.opaque = YES;
self.hidden = NO;
self.paused = TRUE;
self.enableSetNeedsDisplay = FALSE;
self.clearColor = MTLClearColorMake(0.0, 0.0, 0.0, 0.0);
self.contentScaleFactor = [[UIScreen mainScreen] nativeScale];
}
@end