Mac and Linux SDL2 binary snapshots
Edward Rudd
2020-05-02 03f8528315fa46c95991a34f3325d7b33ae5538c
source/src/video/wayland/SDL_waylandopengles.c
@@ -1,6 +1,6 @@
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
  Copyright (C) 1997-2020 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
@@ -22,11 +22,16 @@
#if SDL_VIDEO_DRIVER_WAYLAND && SDL_VIDEO_OPENGL_EGL
#include "../SDL_sysvideo.h"
#include "../../events/SDL_windowevents_c.h"
#include "SDL_waylandvideo.h"
#include "SDL_waylandopengles.h"
#include "SDL_waylandwindow.h"
#include "SDL_waylandevents_c.h"
#include "SDL_waylanddyn.h"
#include "xdg-shell-client-protocol.h"
#include "xdg-shell-unstable-v6-client-protocol.h"
/* EGL implementation of SDL OpenGL ES support */
@@ -57,10 +62,17 @@
int
Wayland_GLES_SwapWindow(_THIS, SDL_Window *window)
{
    if (SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface) < 0) {
    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
    if (SDL_EGL_SwapBuffers(_this, data->egl_surface) < 0) {
        return -1;
    }
    WAYLAND_wl_display_flush( ((SDL_VideoData*)_this->driverdata)->display );
    // Wayland-EGL forbids drawing calls in-between SwapBuffers and wl_egl_window_resize
    Wayland_HandlePendingResize(window);
    WAYLAND_wl_display_flush( data->waylandData->display );
    return 0;
}
@@ -81,6 +93,23 @@
    return ret;
}
void
Wayland_GLES_GetDrawableSize(_THIS, SDL_Window * window, int * w, int * h)
{
    SDL_WindowData *data;
    if (window->driverdata) {
        data = (SDL_WindowData *) window->driverdata;
        if (w) {
            *w = window->w * data->scale_factor;
        }
        if (h) {
            *h = window->h * data->scale_factor;
        }
    }
}
void 
Wayland_GLES_DeleteContext(_THIS, SDL_GLContext context)
{