From ca934031b54c7c9e55a362ab4c73414d742bd6b1 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 24 Apr 2026 09:06:17 -0700
Subject: [PATCH] Only lock landscape orientation on phones
Locking orientation doesn't work on iPad, you end up with a landscape layout on a portrait layer and the right side is clipped out. We handle portrait mode gracefully now, and it works pretty well on tablets, so let's allow that.
---
game/init.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/game/init.cpp b/game/init.cpp
index 2a3602d0..31ca25eb 100644
--- a/game/init.cpp
+++ b/game/init.cpp
@@ -875,8 +875,10 @@ bool StartInitialization(int window_width, int window_height, Uint32 window_flag
gInitializing = true;
- // Lock the screen into landscape orientation
- SDL_SetHint(SDL_HINT_ORIENTATIONS, "LandscapeLeft LandscapeRight");
+ // Lock the screen into landscape orientation on phones
+ if (IsPhone()) {
+ SDL_SetHint(SDL_HINT_ORIENTATIONS, "LandscapeLeft LandscapeRight");
+ }
if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_GAMEPAD)) {
error("Couldn't initialize SDL: %s\n", SDL_GetError());