| Summary: | Make the Android window creation similar to iOS' window creation | ||
|---|---|---|---|
| Product: | SDL | Reporter: | David Serrano <davidantonioserrano66> |
| Component: | video | Assignee: | Sylvain <sylvain.becker> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | amaranth72 |
| Version: | don't know | ||
| Hardware: | Other | ||
| OS: | Android (All) | ||
| Attachments: | patch | ||
|
Description
David Serrano
2016-01-11 01:38:19 UTC
SDL on iOS also currently respects the SDL_HINT_ORIENTATIONS hint ( https://hg.libsdl.org/SDL/file/b86bef2d4f30/include/SDL_hints.h#l269 ). When that hint is set, its values take precedence over the window's requested aspect ratio and resizable flag. SDL on Android (and on WinRT I guess too) could match that behaviour to be more consistent. Created attachment 2839 [details]
patch
Here's a patch.
It tries to get the hint first. Resizable will allow any orientation. Otherwise it uses width/height window.
setOrientation method is splitted in static and non-static, so that it can be overloaded in a user subclass.
Some artefact observed :
surfaceChanged() can be called twice at the beginning. When the phone starts in portrait and run a landscape application.
Patch applied, thanks! https://hg.libsdl.org/SDL/rev/31ce9a8ce2bd |