mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-03 16:36:25 +00:00
Fixed bug 3235 - Make the Android window creation similar to iOS' window creation
Sylvain 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.
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "SDL_androidvideo.h"
|
||||
#include "SDL_androidwindow.h"
|
||||
#include "SDL_hints.h"
|
||||
|
||||
int
|
||||
Android_CreateWindow(_THIS, SDL_Window * window)
|
||||
@@ -42,6 +43,9 @@ Android_CreateWindow(_THIS, SDL_Window * window)
|
||||
Android_PauseSem = SDL_CreateSemaphore(0);
|
||||
Android_ResumeSem = SDL_CreateSemaphore(0);
|
||||
|
||||
/* Set orientation */
|
||||
Android_JNI_SetOrientation(window->w, window->h, window->flags & SDL_WINDOW_RESIZABLE, SDL_GetHint(SDL_HINT_ORIENTATIONS));
|
||||
|
||||
/* Adjust the window data to match the screen */
|
||||
window->x = 0;
|
||||
window->y = 0;
|
||||
|
Reference in New Issue
Block a user