From f522c5380cb371a83d21d3d01f088ce5b9531263 Mon Sep 17 00:00:00 2001
From: Frank Praznik <[EMAIL REDACTED]>
Date: Mon, 26 Jun 2023 11:58:56 -0400
Subject: [PATCH] wayland: Don't initialize OpenGL when the window flags didn't
specify it
Applications that don't specify a rendering flag are likely handling Vulkan/GL themselves, so SDL loading OpenGL by default in this case is unnecessary overhead, and if a render backend requires it, the window will be recreated with the appropriate flags when the renderer is initialized.
(cherry picked from commit 9ab20251277d001ee34caeb59a7eaa54b40af622)
---
src/video/wayland/SDL_waylandwindow.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c
index 303f5982b7d9..a1ebf750700a 100644
--- a/src/video/wayland/SDL_waylandwindow.c
+++ b/src/video/wayland/SDL_waylandwindow.c
@@ -2001,13 +2001,6 @@ int Wayland_CreateWindow(_THIS, SDL_Window *window)
c = _this->driverdata;
window->driverdata = data;
- if (!(window->flags & SDL_WINDOW_VULKAN)) {
- if (!(window->flags & SDL_WINDOW_OPENGL)) {
- SDL_GL_LoadLibrary(NULL);
- window->flags |= SDL_WINDOW_OPENGL;
- }
- }
-
if (window->x == SDL_WINDOWPOS_UNDEFINED) {
window->x = 0;
}