mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-05 09:26:25 +00:00
wayland: Fix building with SDL_OPENGL=OFF
This commit is contained in:
@@ -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: */
|
||||
|
Reference in New Issue
Block a user