summaryrefslogtreecommitdiffstats
path: root/Common/NativeApp
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-12-28 04:09:48 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-12-28 04:09:48 +0000
commit16e72665d082500d32542921be0dfb87509bcecf (patch)
tree4f773cd6c5b144cb9cec53f782111873fc927fa2 /Common/NativeApp
parentUpdated core; added GraphicsAccessories' public header tests (diff)
downloadDiligentEngine-16e72665d082500d32542921be0dfb87509bcecf.tar.gz
DiligentEngine-16e72665d082500d32542921be0dfb87509bcecf.zip
Fixed issue with transitioning to full screen in Vulkan mode on Mac
Diffstat (limited to 'Common/NativeApp')
-rw-r--r--Common/NativeApp/Apple/Source/Classes/OSX/WindowController.m34
1 files changed, 30 insertions, 4 deletions
diff --git a/Common/NativeApp/Apple/Source/Classes/OSX/WindowController.m b/Common/NativeApp/Apple/Source/Classes/OSX/WindowController.m
index 3a37fc6..794ec4e 100644
--- a/Common/NativeApp/Apple/Source/Classes/OSX/WindowController.m
+++ b/Common/NativeApp/Apple/Source/Classes/OSX/WindowController.m
@@ -42,11 +42,21 @@
//...don't do anything
return;
}
+
+ GLView* glView = nil;
+ if ([self.window.contentView isKindOfClass: [GLView class]])
+ {
+ glView = (GLView *)self.window.contentView;
+ }
+
// We must stop the display link while
// switching the windows to make sure
// that render commands are not issued
// from another thread
- [self.window.contentView stopDisplayLink];
+ if (glView != nil)
+ {
+ [glView stopDisplayLink];
+ }
// Allocate a new fullscreen window
[self setFullscreenWindow: [[FullscreenWindow alloc] init]];
@@ -76,7 +86,10 @@
[[self fullscreenWindow] makeKeyAndOrderFront:self];
// Restore display link
- [self.window.contentView startDisplayLink];
+ if (glView != nil)
+ {
+ [glView startDisplayLink];
+ }
}
- (void) goWindow
@@ -87,11 +100,21 @@
//...app is already windowed so don't do anything
return;
}
+
+ GLView* glView = nil;
+ if ([self.window.contentView isKindOfClass: [GLView class]])
+ {
+ glView = (GLView *)self.window.contentView;
+ }
+
// We must stop the display link while
// switching the windows to make sure
// that render commands are not issued
// from another thread
- [self.window.contentView stopDisplayLink];
+ if (glView)
+ {
+ [glView stopDisplayLink];
+ }
// Get the rectangle of the original window
NSRect viewRect = [[self standardWindow] frame];
@@ -117,7 +140,10 @@
[self setFullscreenWindow: nil];
// Restore display link
- [self.window.contentView startDisplayLink];
+ if (glView)
+ {
+ [glView startDisplayLink];
+ }
}