@@ -22,39 +22,39 @@ @implementation EngineView {
22
22
}
23
23
24
24
- (instancetype )init : (RCTBridge*)_bridge {
25
- #ifdef TARGET_OS_OSX
26
- const CGSize monitor = [[NSScreen mainScreen ] frame ].size ;
27
- const CGSize appWin = [[NSApp mainWindow ] frame ].size ;
28
- if (self = [super initWithFrame: CGRectMake ((appWin.width - monitor.width) / 2 , (appWin.height - monitor.height) / 2 , monitor.width, monitor.height)
25
+ #ifdef TARGET_OS_OSX
26
+ const CGSize monitor = [[NSScreen mainScreen ] frame ].size ;
27
+ const CGSize appWin = [[NSApp mainWindow ] frame ].size ;
28
+ if (self = [super initWithFrame: CGRectMake ((appWin.width - monitor.width) / 2 , (appWin.height - monitor.height) / 2 , monitor.width, monitor.height)
29
29
device: MTLCreateSystemDefaultDevice ()]) {
30
30
bridge = _bridge;
31
31
super.translatesAutoresizingMaskIntoConstraints = false ;
32
32
super.colorPixelFormat = MTLPixelFormatBGRA8Unorm_sRGB ;
33
33
super.depthStencilPixelFormat = MTLPixelFormatDepth32Float ;
34
34
}
35
35
36
- [self setBounds: CGRectMake ((appWin.width - monitor.width) / 2 , (appWin.height - monitor.height) / 2 , monitor.width, monitor.height)];
37
- #else
38
- if (self = [super initWithFrame: CGRectZero device: MTLCreateSystemDefaultDevice ()]) {
36
+ [self setBounds: CGRectMake ((appWin.width - monitor.width) / 2 , (appWin.height - monitor.height) / 2 , monitor.width, monitor.height)];
37
+ #else
38
+ if (self = [super initWithFrame: CGRectZero device: MTLCreateSystemDefaultDevice ()]) {
39
39
bridge = _bridge;
40
40
super.translatesAutoresizingMaskIntoConstraints = false ;
41
41
super.colorPixelFormat = MTLPixelFormatBGRA8Unorm_sRGB ;
42
42
super.depthStencilPixelFormat = MTLPixelFormatDepth32Float ;
43
43
}
44
- #endif
44
+ #endif
45
45
return self;
46
46
}
47
47
48
48
- (void )setIsTransparentFlag : (NSNumber *)isTransparentFlag {
49
- #ifndef TARGET_OS_OSX
49
+ #ifndef TARGET_OS_OSX
50
50
BOOL isTransparent = [isTransparentFlag intValue ] == 1 ;
51
51
if (isTransparent){
52
52
[self setOpaque: NO ];
53
53
} else {
54
54
[self setOpaque: YES ];
55
55
}
56
56
self.isTransparent = isTransparent;
57
- #endif
57
+ #endif
58
58
}
59
59
60
60
- (void )setMSAA : (NSNumber *)value {
@@ -99,7 +99,7 @@ - (void)drawRect:(CGRect)rect {
99
99
[xrView removeFromSuperview ];
100
100
xrView = nil ;
101
101
}
102
- #endif
102
+ #endif
103
103
[BabylonNativeInterop renderView ];
104
104
}
105
105
@@ -108,7 +108,7 @@ - (void)dealloc {
108
108
}
109
109
110
110
- (void )takeSnapshot {
111
- #ifndef TARGET_OS_OSX
111
+ #ifndef TARGET_OS_OSX
112
112
// We must take the screenshot on the main thread otherwise we might fail to get a valid handle on the view's image.
113
113
dispatch_async (dispatch_get_main_queue (), ^{
114
114
// Start the graphics context.
@@ -128,7 +128,7 @@ - (void)takeSnapshot {
128
128
self.onSnapshotDataReturned (@{ @" data" :encodedData});
129
129
}
130
130
});
131
- #endif
131
+ #endif
132
132
}
133
133
134
134
#ifdef TARGET_OS_OSX
0 commit comments