97 lines
3.6 KiB
Diff
97 lines
3.6 KiB
Diff
|
From ed3442d7a5a79b3a7357c5bdf54b47ab985ca7f7 Mon Sep 17 00:00:00 2001
|
||
|
From: Ethan Lee <flibitijibibo@gmail.com>
|
||
|
Date: Wed, 19 Jan 2022 15:47:52 -0500
|
||
|
Subject: [PATCH 03/11] wayland: Fix building with SDL_OPENGL=OFF
|
||
|
|
||
|
---
|
||
|
src/video/wayland/SDL_waylandvideo.c | 2 ++
|
||
|
src/video/wayland/SDL_waylandwindow.c | 8 ++++++--
|
||
|
src/video/wayland/SDL_waylandwindow.h | 2 ++
|
||
|
3 files changed, 10 insertions(+), 2 deletions(-)
|
||
|
|
||
|
diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c
|
||
|
index f009fb7c6..60d7403c7 100644
|
||
|
--- a/src/video/wayland/SDL_waylandvideo.c
|
||
|
+++ b/src/video/wayland/SDL_waylandvideo.c
|
||
|
@@ -230,6 +230,7 @@ Wayland_CreateDevice(int devindex)
|
||
|
device->WaitEventTimeout = Wayland_WaitEventTimeout;
|
||
|
device->SendWakeupEvent = Wayland_SendWakeupEvent;
|
||
|
|
||
|
+#if SDL_VIDEO_OPENGL_EGL
|
||
|
device->GL_SwapWindow = Wayland_GLES_SwapWindow;
|
||
|
device->GL_GetSwapInterval = Wayland_GLES_GetSwapInterval;
|
||
|
device->GL_SetSwapInterval = Wayland_GLES_SetSwapInterval;
|
||
|
@@ -240,6 +241,7 @@ Wayland_CreateDevice(int devindex)
|
||
|
device->GL_UnloadLibrary = Wayland_GLES_UnloadLibrary;
|
||
|
device->GL_GetProcAddress = Wayland_GLES_GetProcAddress;
|
||
|
device->GL_DeleteContext = Wayland_GLES_DeleteContext;
|
||
|
+#endif
|
||
|
|
||
|
device->CreateSDLWindow = Wayland_CreateWindow;
|
||
|
device->ShowWindow = Wayland_ShowWindow;
|
||
|
diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c
|
||
|
index a4b5933eb..80bb66878 100644
|
||
|
--- a/src/video/wayland/SDL_waylandwindow.c
|
||
|
+++ b/src/video/wayland/SDL_waylandwindow.c
|
||
|
@@ -21,7 +21,7 @@
|
||
|
|
||
|
#include "../../SDL_internal.h"
|
||
|
|
||
|
-#if SDL_VIDEO_DRIVER_WAYLAND && SDL_VIDEO_OPENGL_EGL
|
||
|
+#if SDL_VIDEO_DRIVER_WAYLAND
|
||
|
|
||
|
#include "../SDL_sysvideo.h"
|
||
|
#include "../../events/SDL_windowevents_c.h"
|
||
|
@@ -1309,12 +1309,14 @@ int Wayland_CreateWindow(_THIS, SDL_Window *window)
|
||
|
data->egl_window = WAYLAND_wl_egl_window_create(data->surface,
|
||
|
window->w * data->scale_factor, window->h * data->scale_factor);
|
||
|
|
||
|
+#if SDL_VIDEO_OPENGL_EGL
|
||
|
/* Create the GLES window surface */
|
||
|
data->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType) data->egl_window);
|
||
|
|
||
|
if (data->egl_surface == EGL_NO_SURFACE) {
|
||
|
return SDL_SetError("failed to create an EGL window surface");
|
||
|
}
|
||
|
+#endif
|
||
|
}
|
||
|
|
||
|
#ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
|
||
|
@@ -1517,9 +1519,11 @@ void Wayland_DestroyWindow(_THIS, SDL_Window *window)
|
||
|
SDL_WindowData *wind = window->driverdata;
|
||
|
|
||
|
if (data) {
|
||
|
+#if SDL_VIDEO_OPENGL_EGL
|
||
|
if (wind->egl_surface) {
|
||
|
SDL_EGL_DestroySurface(_this, wind->egl_surface);
|
||
|
}
|
||
|
+#endif
|
||
|
if (wind->egl_window) {
|
||
|
WAYLAND_wl_egl_window_destroy(wind->egl_window);
|
||
|
}
|
||
|
@@ -1555,6 +1559,6 @@ void Wayland_DestroyWindow(_THIS, SDL_Window *window)
|
||
|
window->driverdata = NULL;
|
||
|
}
|
||
|
|
||
|
-#endif /* SDL_VIDEO_DRIVER_WAYLAND && SDL_VIDEO_OPENGL_EGL */
|
||
|
+#endif /* SDL_VIDEO_DRIVER_WAYLAND */
|
||
|
|
||
|
/* vi: set ts=4 sw=4 expandtab: */
|
||
|
diff --git a/src/video/wayland/SDL_waylandwindow.h b/src/video/wayland/SDL_waylandwindow.h
|
||
|
index bce1d1855..e8d7d6299 100644
|
||
|
--- a/src/video/wayland/SDL_waylandwindow.h
|
||
|
+++ b/src/video/wayland/SDL_waylandwindow.h
|
||
|
@@ -63,7 +63,9 @@ typedef struct {
|
||
|
} shell_surface;
|
||
|
struct wl_egl_window *egl_window;
|
||
|
struct SDL_WaylandInput *keyboard_device;
|
||
|
+#if SDL_VIDEO_OPENGL_EGL
|
||
|
EGLSurface egl_surface;
|
||
|
+#endif
|
||
|
struct zwp_locked_pointer_v1 *locked_pointer;
|
||
|
struct zwp_confined_pointer_v1 *confined_pointer;
|
||
|
struct zxdg_toplevel_decoration_v1 *server_decoration;
|
||
|
--
|
||
|
2.34.1
|
||
|
|