Mac and Linux SDL2 binary snapshots
Edward Rudd
2018-08-19 561f0d614098a95527367cc3f911e476f35643d6
source/src/video/vivante/SDL_vivantevideo.c
@@ -1,6 +1,6 @@
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
  Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
@@ -88,7 +88,7 @@
    device->VideoQuit = VIVANTE_VideoQuit;
    device->GetDisplayModes = VIVANTE_GetDisplayModes;
    device->SetDisplayMode = VIVANTE_SetDisplayMode;
    device->CreateWindow = VIVANTE_CreateWindow;
    device->CreateSDLWindow = VIVANTE_CreateWindow;
    device->SetWindowTitle = VIVANTE_SetWindowTitle;
    device->SetWindowPosition = VIVANTE_SetWindowPosition;
    device->SetWindowSize = VIVANTE_SetWindowSize;
@@ -97,6 +97,7 @@
    device->DestroyWindow = VIVANTE_DestroyWindow;
    device->GetWindowWMInfo = VIVANTE_GetWindowWMInfo;
#if SDL_VIDEO_OPENGL_EGL
    device->GL_LoadLibrary = VIVANTE_GLES_LoadLibrary;
    device->GL_GetProcAddress = VIVANTE_GLES_GetProcAddress;
    device->GL_UnloadLibrary = VIVANTE_GLES_UnloadLibrary;
@@ -106,6 +107,7 @@
    device->GL_GetSwapInterval = VIVANTE_GLES_GetSwapInterval;
    device->GL_SwapWindow = VIVANTE_GLES_SwapWindow;
    device->GL_DeleteContext = VIVANTE_GLES_DeleteContext;
#endif
    device->PumpEvents = VIVANTE_PumpEvents;
@@ -152,6 +154,9 @@
    switch (bpp)
    {
    default: /* Is another format used? */
    case 32:
        current_mode.format = SDL_PIXELFORMAT_ARGB8888;
        break;
    case 16:
        current_mode.format = SDL_PIXELFORMAT_RGB565;
        break;
@@ -160,6 +165,7 @@
    current_mode.refresh_rate = 60;
    SDL_zero(display);
    display.name = VIVANTE_GetDisplayName(_this);
    display.desktop_mode = current_mode;
    display.current_mode = current_mode;
    display.driverdata = data;
@@ -207,6 +213,8 @@
    if (VIVANTE_AddVideoDisplays(_this) < 0) {
        return -1;
    }
    VIVANTE_UpdateDisplayScale(_this);
#ifdef SDL_INPUT_LINUXEV
    if (SDL_EVDEV_Init() < 0) {
@@ -281,6 +289,7 @@
        return SDL_SetError("VIVANTE: Can't create native window");
    }
#if SDL_VIDEO_OPENGL_EGL
    if (window->flags & SDL_WINDOW_OPENGL) {
        data->egl_surface = SDL_EGL_CreateSurface(_this, data->native_window);
        if (data->egl_surface == EGL_NO_SURFACE) {
@@ -289,6 +298,7 @@
    } else {
        data->egl_surface = EGL_NO_SURFACE;
    }
#endif
    /* Window has been successfully created */
    return 0;
@@ -302,9 +312,11 @@
    data = window->driverdata;
    if (data) {
#if SDL_VIDEO_OPENGL_EGL
        if (data->egl_surface != EGL_NO_SURFACE) {
            SDL_EGL_DestroySurface(_this, data->egl_surface);
        }
#endif
        if (data->native_window) {
#if SDL_VIDEO_DRIVER_VIVANTE_VDK
@@ -376,7 +388,7 @@
        info->info.vivante.window = data->native_window;
        return SDL_TRUE;
    } else {
        SDL_SetError("Application not compiled with SDL %d.%d\n",
        SDL_SetError("Application not compiled with SDL %d.%d",
                     SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
        return SDL_FALSE;
    }