mirror of
https://github.com/encounter/SDL.git
synced 2025-12-16 08:27:05 +00:00
Fixed initial display orientation at Android app start
This commit is contained in:
@@ -172,8 +172,10 @@ VideoBootStrap Android_bootstrap = {
|
||||
int
|
||||
Android_VideoInit(_THIS)
|
||||
{
|
||||
SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata;
|
||||
SDL_DisplayMode mode;
|
||||
SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata;
|
||||
int display_index;
|
||||
SDL_VideoDisplay *display;
|
||||
SDL_DisplayMode mode;
|
||||
|
||||
videodata->isPaused = SDL_FALSE;
|
||||
videodata->isPausing = SDL_FALSE;
|
||||
@@ -184,9 +186,12 @@ Android_VideoInit(_THIS)
|
||||
mode.refresh_rate = Android_ScreenRate;
|
||||
mode.driverdata = NULL;
|
||||
|
||||
if (SDL_AddBasicVideoDisplay(&mode) < 0) {
|
||||
display_index = SDL_AddBasicVideoDisplay(&mode);
|
||||
if (display_index < 0) {
|
||||
return -1;
|
||||
}
|
||||
display = SDL_GetDisplay(display_index);
|
||||
display->orientation = Android_JNI_GetDisplayOrientation();
|
||||
|
||||
SDL_AddDisplayMode(&_this->displays[0], &mode);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user