Repo created
This commit is contained in:
parent
4af19165ec
commit
68073add76
12458 changed files with 12350765 additions and 2 deletions
35
iphone/Maps/Classes/MetalView.mm
Normal file
35
iphone/Maps/Classes/MetalView.mm
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#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
|
||||
Loading…
Add table
Add a link
Reference in a new issue