| Summary: | Patch that enables configuration of allowable screen orientations on iOS | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Tim Angus <tim> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | enhancement | ||
| Priority: | P2 | CC: | icculus |
| Version: | HG 2.0 | ||
| Hardware: | ARM | ||
| OS: | iOS (All) | ||
| Attachments: |
Patch that enables configuration of allowable screen orientations on iOS
Patch that enables configuration of allowable screen orientations on iOS |
||
Created attachment 620 [details]
Patch that enables configuration of allowable screen orientations on iOS
I added some documentation to SDL_hints.h, and changed the name of the hint.
This is now hg revision 4b4258be8699, thanks! --ryan. |
Created attachment 614 [details] Patch that enables configuration of allowable screen orientations on iOS For a title I'm developing, the default behaviour of allowing either both portrait orientations or both landscape orientations doesn't really work to the point where it breaks the core game play mechanic. Setting SDL_WINDOW_RESIZABLE and enabling all rotations makes the problem worse. Really what I want to do is restrict which orientations are allowable. Attached is a patch to do this using the hint API. In my particular case I want portrait only: SDL_SetHint( "SDL_HINT_ORIENTATIONS", "Portrait" ); The second parameter is a space delimited list of the orientations required. If you wanted all orientations then you would call: SDL_SetHint( "SDL_HINT_ORIENTATIONS", "Portrait PortraitUpsideDown LandscapeLeft LandscapeRight" ); I think this is a fairly important bit of functionality to have, so it would be nice to see it committed at some point. It may also be worth considering removing the code which treats having SDL_WINDOW_RESIZABLE set as indicating you want all orientations as that functionality is now available with the patch applied. Obviously this would change existing functionality though, so I haven't made this change.