Mac and Linux SDL2 binary snapshots
Edward Rudd
2018-08-19 561f0d614098a95527367cc3f911e476f35643d6
source/src/video/mir/SDL_mirvideo.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
@@ -27,6 +27,9 @@
#if SDL_VIDEO_DRIVER_MIR
#include "SDL_assert.h"
#include "SDL_log.h"
#include "SDL_mirwindow.h"
#include "SDL_video.h"
@@ -34,6 +37,7 @@
#include "SDL_mirmouse.h"
#include "SDL_miropengl.h"
#include "SDL_mirvideo.h"
#include "SDL_mirvulkan.h"
#include "SDL_mirdyn.h"
@@ -98,7 +102,19 @@
    int available = 0;
    if (SDL_MIR_LoadSymbols()) {
        /* !!! FIXME: try to make a MirConnection here. */
        /* Lets ensure we can connect to the mir server */
        MirConnection* connection = MIR_mir_connect_sync(NULL, SDL_FUNCTION);
        if (!MIR_mir_connection_is_valid(connection)) {
            SDL_LogWarn(SDL_LOG_CATEGORY_VIDEO, "Unable to connect to the mir server %s",
                MIR_mir_connection_get_error_message(connection));
            return available;
        }
        MIR_mir_connection_release(connection);
        available = 1;
        SDL_MIR_UnloadSymbols();
    }
@@ -165,7 +181,7 @@
    device->GL_GetProcAddress  = MIR_GL_GetProcAddress;
    /* mirwindow */
    device->CreateWindow         = MIR_CreateWindow;
    device->CreateSDLWindow         = MIR_CreateWindow;
    device->DestroyWindow        = MIR_DestroyWindow;
    device->GetWindowWMInfo      = MIR_GetWindowWMInfo;
    device->SetWindowFullscreen  = MIR_SetWindowFullscreen;
@@ -182,7 +198,7 @@
    device->SetWindowGammaRamp   = MIR_SetWindowGammaRamp;
    device->GetWindowGammaRamp   = MIR_GetWindowGammaRamp;
    device->CreateWindowFrom     = NULL;
    device->CreateSDLWindowFrom     = NULL;
    device->SetWindowIcon        = NULL;
    device->RaiseWindow          = NULL;
    device->SetWindowBordered    = NULL;
@@ -217,6 +233,13 @@
    device->HasClipboardText = NULL;
    device->ShowMessageBox = NULL;
#if SDL_VIDEO_VULKAN
    device->Vulkan_LoadLibrary = MIR_Vulkan_LoadLibrary;
    device->Vulkan_UnloadLibrary = MIR_Vulkan_UnloadLibrary;
    device->Vulkan_GetInstanceExtensions = MIR_Vulkan_GetInstanceExtensions;
    device->Vulkan_CreateSurface = MIR_Vulkan_CreateSurface;
#endif
    return device;
}
@@ -255,7 +278,7 @@
    MirPixelFormat format = MIR_mir_output_get_current_pixel_format(output);
    int num_modes         = MIR_mir_output_get_num_modes(output);
    SDL_DisplayMode current_mode = MIR_ConvertModeToSDLMode(mir_output_get_current_mode(output), format);
    SDL_DisplayMode current_mode = MIR_ConvertModeToSDLMode(MIR_mir_output_get_current_mode(output), format);
    SDL_zero(display);
@@ -297,7 +320,7 @@
{
    MIR_Data* mir_data = _this->driverdata;
    mir_data->connection     = MIR_mir_connect_sync(NULL, __PRETTY_FUNCTION__);
    mir_data->connection     = MIR_mir_connect_sync(NULL, SDL_FUNCTION);
    mir_data->current_window = NULL;
    mir_data->software       = SDL_FALSE;
    mir_data->pixel_format   = mir_pixel_format_invalid;