Added HDR support on visionOS

This commit is contained in:
Sam Lantinga
2026-07-03 13:32:44 -07:00
parent 9123f69cdd
commit efce7ca4b1
2 changed files with 6 additions and 0 deletions

View File

@@ -285,6 +285,7 @@ internal struct SDL_CurvedContentView: View {
helper.updateSnappedStatus(snapped: snappedStatus.isSnapped)
}
.preferredSurroundingsEffect(shouldEnableDimming ? .dark : nil)
.allowedDynamicRange(.high)
.frame(depth: 0)
.ignoresSafeArea()
.persistentSystemOverlays(settings.sceneState == .cinematic ? .hidden : .automatic)

View File

@@ -283,6 +283,11 @@ bool UIKit_AddDisplay(bool send_event)
display.desktop_mode = mode;
// There isn't currently a way to query the EDR headeroom on visionOS.
// The range is 1 - 16, so we'll assume a current value of 2 for now.
display.HDR.SDR_white_level = 1.0f;
display.HDR.HDR_headroom = 2.0f;
SDL_UIKitDisplayData *data = [[SDL_UIKitDisplayData alloc] init];
if (!data) {