src/video/android/SDL_androidvideo.c
changeset 12625 e58468e48179
parent 12556 9b2e48b381db
child 12693 d311fcb8066a
     1.1 --- a/src/video/android/SDL_androidvideo.c	Tue Mar 12 14:44:12 2019 -0700
     1.2 +++ b/src/video/android/SDL_androidvideo.c	Tue Mar 12 14:44:25 2019 -0700
     1.3 @@ -172,8 +172,10 @@
     1.4  int
     1.5  Android_VideoInit(_THIS)
     1.6  {
     1.7 -    SDL_VideoData   *videodata = (SDL_VideoData *)_this->driverdata;
     1.8 -    SDL_DisplayMode  mode;
     1.9 +    SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata;
    1.10 +    int display_index;
    1.11 +    SDL_VideoDisplay *display;
    1.12 +    SDL_DisplayMode mode;
    1.13  
    1.14      videodata->isPaused  = SDL_FALSE;
    1.15      videodata->isPausing = SDL_FALSE;
    1.16 @@ -184,9 +186,12 @@
    1.17      mode.refresh_rate    = Android_ScreenRate;
    1.18      mode.driverdata      = NULL;
    1.19  
    1.20 -    if (SDL_AddBasicVideoDisplay(&mode) < 0) {
    1.21 +    display_index = SDL_AddBasicVideoDisplay(&mode);
    1.22 +    if (display_index < 0) {
    1.23          return -1;
    1.24      }
    1.25 +    display = SDL_GetDisplay(display_index);
    1.26 +    display->orientation = Android_JNI_GetDisplayOrientation();    
    1.27  
    1.28      SDL_AddDisplayMode(&_this->displays[0], &mode);
    1.29