Hello there, having an issue capping the rendering resolution of the secondary display. Unity 2022.3x
Basically we built an iOS game, and we need to cap the resolution otherwise it simply won’t run off the iPhone when connected to a secondary display.
When we connect the phone to a 1080P TV it works fine. But when connected to the 4K Display it overheats and destroys the user experience. How can we cap the resolution and FPS that the game runs at for iOS connected to an external display?
We are using an iPhone 15+ connected through HDMI through the USB C port to a TV or display.
We can do it in iOS native code, as below:
import SwiftUI
import UIKit
class ExternalSceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = (scene as? UIWindowScene) else { return }
if session.role == .windowExternalDisplayNonInteractive {
let screen = windowScene.screen
// Set the resolution to 1920x1080
if let targetMode = screen.availableModes.first(where: { $0.size == CGSize(width: 1920, height: 1080) }) {
screen.currentMode = targetMode
}
// Create and set up the window for this scene
let window = UIWindow(windowScene: windowScene)
let screenSize = screen.bounds.size // Get the actual screen size
window.rootViewController = UIHostingController(rootView: ExternalRootView(model: (UIApplication.shared.delegate as! AppDelegate).model, screenSize: screenSize))
window.makeKeyAndVisible()
self.window = window
}
}
}
But we can’t seem to set this in unity?