Handling orientation on Android.
This commit is contained in:
parent
6e1b801de2
commit
4e4a6e569d
1 changed files with 14 additions and 1 deletions
|
|
@ -24044,12 +24044,25 @@ static void setup(void)
|
||||||
|
|
||||||
|
|
||||||
/* Deal with orientation rotation option */
|
/* Deal with orientation rotation option */
|
||||||
|
#if defined __ANDROID__
|
||||||
|
SDL_SetHint(SDL_HINT_ORIENTATIONS, "LandscapeRight");
|
||||||
|
#endif
|
||||||
|
|
||||||
if (rotate_orientation)
|
if (rotate_orientation)
|
||||||
{
|
{
|
||||||
if (native_screensize && fullscreen)
|
if (native_screensize && fullscreen)
|
||||||
{
|
{
|
||||||
|
#if defined __ANDROID__
|
||||||
|
/* FIXME 2019-11-02: Could this work on every device instead of just Android ones? */
|
||||||
|
SDL_SetHint(SDL_HINT_ORIENTATIONS, "Portrait");
|
||||||
|
int tmp;
|
||||||
|
|
||||||
|
tmp = WINDOW_WIDTH;
|
||||||
|
WINDOW_WIDTH = WINDOW_HEIGHT;
|
||||||
|
WINDOW_HEIGHT = tmp;
|
||||||
|
#else
|
||||||
fprintf(stderr, "Warning: Asking for native screen size overrides request to rotate orientation.\n");
|
fprintf(stderr, "Warning: Asking for native screen size overrides request to rotate orientation.\n");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue