1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-31 18:41:20 +00:00

Add platform lifecycle callbacks to CameraServer base class

This commit is contained in:
KOGA Mitsuhiro
2025-11-29 07:14:40 +09:00
parent f5918a9d35
commit 85ec5b9f42
8 changed files with 44 additions and 30 deletions

View File

@@ -38,6 +38,7 @@
#import "os_apple_embedded.h"
#include "core/config/project_settings.h"
#include "servers/camera/camera_server.h"
#import <AVFoundation/AVFoundation.h>
#import <GameController/GameController.h>
@@ -238,6 +239,24 @@
// MARK: Orientation
#if TARGET_OS_IPHONE
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
[coordinator animateAlongsideTransition:nil
completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
// Get the new interface orientation after rotation completes (iOS only)
UIInterfaceOrientation orientation = self.view.window.windowScene.interfaceOrientation;
// Notify camera server of orientation change
CameraServer *camera_server = CameraServer::get_singleton();
if (camera_server) {
camera_server->handle_display_rotation_change((int)orientation);
}
}];
}
#endif // TARGET_OS_IPHONE
- (UIRectEdge)preferredScreenEdgesDeferringSystemGestures {
if (GLOBAL_GET("display/window/ios/suppress_ui_gesture")) {
return UIRectEdgeAll;