SDL_HINT_ORIENTATIONS not working on Android

Just a quick question: on Android using a semi-recent pull of 2.0.15 from the repo, I’m not getting any luck with orientation. Is this still a work in progress? I tried setting the hint and also changing the manifest, but nothing worked; I had to set is_landscape_allowed and is_portrait_allowed to true in setOrientationBis() in SDLActivity.java before my Pixel would rotate the screen.

The hint I used was this:

 auto const RESULT = SDL_SetHint(SDL_HINT_ORIENTATIONS, "LandscapeLeft LandscapeRight Portrait PortraitUpsideDown");

and it’s returning success. Primarily, I want to know if there’s a better way to allow orientation changes on Android right now than forcing it in that Java method.

Thanks!

1 Like