src/video/android/SDL_androidvideo.c
changeset 9314 8d826bc39a45
parent 9173 c677ab1148c5
child 9317 a8350b28a05c
equal deleted inserted replaced
9313:6f04557c6e1f 9314:8d826bc39a45
    62 
    62 
    63 /* These are filled in with real values in Android_SetScreenResolution on init (before SDL_main()) */
    63 /* These are filled in with real values in Android_SetScreenResolution on init (before SDL_main()) */
    64 int Android_ScreenWidth = 0;
    64 int Android_ScreenWidth = 0;
    65 int Android_ScreenHeight = 0;
    65 int Android_ScreenHeight = 0;
    66 Uint32 Android_ScreenFormat = SDL_PIXELFORMAT_UNKNOWN;
    66 Uint32 Android_ScreenFormat = SDL_PIXELFORMAT_UNKNOWN;
       
    67 int Android_ScreenRate = 0;
       
    68 
    67 SDL_sem *Android_PauseSem = NULL, *Android_ResumeSem = NULL;
    69 SDL_sem *Android_PauseSem = NULL, *Android_ResumeSem = NULL;
    68 
    70 
    69 /* Currently only one window */
    71 /* Currently only one window */
    70 SDL_Window *Android_Window = NULL;
    72 SDL_Window *Android_Window = NULL;
    71 
    73 
   164     SDL_DisplayMode mode;
   166     SDL_DisplayMode mode;
   165 
   167 
   166     mode.format = Android_ScreenFormat;
   168     mode.format = Android_ScreenFormat;
   167     mode.w = Android_ScreenWidth;
   169     mode.w = Android_ScreenWidth;
   168     mode.h = Android_ScreenHeight;
   170     mode.h = Android_ScreenHeight;
   169     mode.refresh_rate = 0;
   171     mode.refresh_rate = Android_ScreenRate;
   170     mode.driverdata = NULL;
   172     mode.driverdata = NULL;
   171     if (SDL_AddBasicVideoDisplay(&mode) < 0) {
   173     if (SDL_AddBasicVideoDisplay(&mode) < 0) {
   172         return -1;
   174         return -1;
   173     }
   175     }
   174 
   176 
   187 {
   189 {
   188 }
   190 }
   189 
   191 
   190 /* This function gets called before VideoInit() */
   192 /* This function gets called before VideoInit() */
   191 void
   193 void
   192 Android_SetScreenResolution(int width, int height, Uint32 format)
   194 Android_SetScreenResolution(int width, int height, Uint32 format, float rate)
   193 {
   195 {
   194     Android_ScreenWidth = width;
   196     Android_ScreenWidth = width;
   195     Android_ScreenHeight = height;
   197     Android_ScreenHeight = height;
   196     Android_ScreenFormat = format;
   198     Android_ScreenFormat = format;
       
   199     Android_ScreenRate = rate;
   197 
   200 
   198     if (Android_Window) {
   201     if (Android_Window) {
   199         SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_RESIZED, width, height);
   202         SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_RESIZED, width, height);
   200     }
   203     }
   201 }
   204 }