Skip to content

Commit 14ef7bd

Browse files
MacOS App: silence display link deprecation warnings
1 parent a36bab5 commit 14ef7bd

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

NativeApp/Apple/Source/Classes/OSX/MetalView.mm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,17 @@ - (void) awakeFromNib
5858

5959
[self initApp:self];
6060

61+
#pragma clang diagnostic push
62+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
63+
6164
CVDisplayLinkRef displayLink;
6265
CVDisplayLinkCreateWithActiveCGDisplays(&displayLink);
6366
[self setDisplayLink:displayLink];
6467
CVDisplayLinkSetOutputCallback(displayLink, &DisplayLinkCallback, (__bridge void*)self);
6568
CVDisplayLinkStart(displayLink);
6669

70+
#pragma clang diagnostic pop
71+
6772
[self setPostsBoundsChangedNotifications:YES];
6873
[self setPostsFrameChangedNotifications:YES];
6974
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(boundsDidChange:) name:NSViewBoundsDidChangeNotification object:self];

NativeApp/Apple/Source/Classes/OSX/ViewBase.mm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ - (BOOL)acceptsFirstResponder
101101
return YES; // To make keyboard events work
102102
}
103103

104+
#pragma clang diagnostic push
105+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
106+
104107
-(void)destroyApp
105108
{
106109
// Stop the display link BEFORE releasing anything in the view
@@ -149,6 +152,8 @@ - (void)startDisplayLink
149152
}
150153
}
151154

155+
#pragma clang diagnostic pop
156+
152157
- (void) windowWillClose:(NSNotification*)notification
153158
{
154159
[self destroyApp];

0 commit comments

Comments
 (0)