|
@@ -282,6 +282,8 @@ static NSCursor *cursorFromSelector(SEL selector, SEL fallback = nil) {
|
|
//_Godotwindow* window;
|
|
//_Godotwindow* window;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+- (void)windowWillClose:(NSNotification *)notification;
|
|
|
|
+
|
|
@end
|
|
@end
|
|
|
|
|
|
@implementation GodotWindowDelegate
|
|
@implementation GodotWindowDelegate
|
|
@@ -294,6 +296,24 @@ static NSCursor *cursorFromSelector(SEL selector, SEL fallback = nil) {
|
|
return NO;
|
|
return NO;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+- (void)windowWillClose:(NSNotification *)notification {
|
|
|
|
+#if defined(VULKAN_ENABLED)
|
|
|
|
+ if (OS_OSX::singleton->video_driver_index == OS::VIDEO_DRIVER_VULKAN) {
|
|
|
|
+
|
|
|
|
+ if (OS_OSX::singleton->rendering_device_vulkan) {
|
|
|
|
+ OS_OSX::singleton->rendering_device_vulkan->finalize();
|
|
|
|
+ memdelete(OS_OSX::singleton->rendering_device_vulkan);
|
|
|
|
+ OS_OSX::singleton->rendering_device_vulkan = NULL;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (OS_OSX::singleton->context_vulkan) {
|
|
|
|
+ memdelete(OS_OSX::singleton->context_vulkan);
|
|
|
|
+ OS_OSX::singleton->context_vulkan = NULL;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
|
|
+}
|
|
|
|
+
|
|
- (void)windowDidEnterFullScreen:(NSNotification *)notification {
|
|
- (void)windowDidEnterFullScreen:(NSNotification *)notification {
|
|
OS_OSX::singleton->zoomed = true;
|
|
OS_OSX::singleton->zoomed = true;
|
|
|
|
|
|
@@ -1632,19 +1652,6 @@ void OS_OSX::finalize() {
|
|
memdelete(context_gles2);
|
|
memdelete(context_gles2);
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
-#if defined(VULKAN_ENABLED)
|
|
|
|
- if (video_driver_index == VIDEO_DRIVER_VULKAN) {
|
|
|
|
-
|
|
|
|
- if (rendering_device_vulkan) {
|
|
|
|
- rendering_device_vulkan->finalize();
|
|
|
|
- memdelete(rendering_device_vulkan);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (context_vulkan)
|
|
|
|
- memdelete(context_vulkan);
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-#endif
|
|
|
|
|
|
|
|
CFNotificationCenterRemoveObserver(CFNotificationCenterGetDistributedCenter(), NULL, kTISNotifySelectedKeyboardInputSourceChanged, NULL);
|
|
CFNotificationCenterRemoveObserver(CFNotificationCenterGetDistributedCenter(), NULL, kTISNotifySelectedKeyboardInputSourceChanged, NULL);
|
|
CGDisplayRemoveReconfigurationCallback(displays_arrangement_changed, NULL);
|
|
CGDisplayRemoveReconfigurationCallback(displays_arrangement_changed, NULL);
|