Mac and Linux SDL2 binary snapshots
Edward Rudd
2019-04-09 9cd2e9ec8fc0127393dfce9c0359d500c8c238be
source/src/video/android/SDL_androidvideo.c
@@ -60,8 +60,10 @@
/* These are filled in with real values in Android_SetScreenResolution on init (before SDL_main()) */
int Android_ScreenWidth = 0;
int Android_ScreenHeight = 0;
int Android_SurfaceWidth = 0;
int Android_SurfaceHeight = 0;
int Android_DeviceWidth = 0;
int Android_DeviceHeight = 0;
Uint32 Android_ScreenFormat = SDL_PIXELFORMAT_UNKNOWN;
static int Android_ScreenRate = 0;
@@ -176,8 +178,8 @@
    SDL_DisplayMode mode;
    mode.format = Android_ScreenFormat;
    mode.w = Android_ScreenWidth;
    mode.h = Android_ScreenHeight;
    mode.w = Android_DeviceWidth;
    mode.h = Android_DeviceHeight;
    mode.refresh_rate = Android_ScreenRate;
    mode.driverdata = NULL;
    if (SDL_AddBasicVideoDisplay(&mode) < 0) {
@@ -199,6 +201,7 @@
void
Android_VideoQuit(_THIS)
{
    Android_QuitMouse();
    Android_QuitTouch();
}
@@ -209,12 +212,14 @@
}
void
Android_SetScreenResolution(int width, int height, Uint32 format, float rate)
Android_SetScreenResolution(int surfaceWidth, int surfaceHeight, int deviceWidth, int deviceHeight, Uint32 format, float rate)
{
   SDL_VideoDevice* device;
   SDL_VideoDisplay *display;
    Android_ScreenWidth = width;
    Android_ScreenHeight = height;
    SDL_VideoDevice* device;
    SDL_VideoDisplay *display;
    Android_SurfaceWidth = surfaceWidth;
    Android_SurfaceHeight = surfaceHeight;
    Android_DeviceWidth = deviceWidth;
    Android_DeviceHeight = deviceHeight;
    Android_ScreenFormat = format;
    Android_ScreenRate = rate;
@@ -229,8 +234,8 @@
    {
        display = &device->displays[0];
        display->desktop_mode.format = Android_ScreenFormat;
        display->desktop_mode.w = Android_ScreenWidth;
        display->desktop_mode.h = Android_ScreenHeight;
        display->desktop_mode.w = Android_DeviceWidth;
        display->desktop_mode.h = Android_DeviceHeight;
        display->desktop_mode.refresh_rate  = Android_ScreenRate;
    }
@@ -240,12 +245,12 @@
        display = SDL_GetDisplayForWindow(Android_Window);
        display->display_modes[0].format = format;
        display->display_modes[0].w = width;
        display->display_modes[0].h = height;
        display->display_modes[0].w = Android_DeviceWidth;
        display->display_modes[0].h = Android_DeviceHeight;
        display->display_modes[0].refresh_rate = rate;
        display->current_mode = display->display_modes[0];
        SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_RESIZED, width, height);
        SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_RESIZED, surfaceWidth, surfaceHeight);
    }
}