SDL: Remove SDL_GL_CONTEXT_EGL #6657 (#6683)

From ab1f4172e39b9021b73ddff6e73339670c3f94c3 Mon Sep 17 00:00:00 2001
From: Sylvain Becker <[EMAIL REDACTED]>
Date: Thu, 1 Dec 2022 23:53:37 +0100
Subject: [PATCH] Remove SDL_GL_CONTEXT_EGL #6657 (#6683)

---
 WhatsNew.txt             |  2 ++
 docs/README-migration.md |  5 +++++
 include/SDL3/SDL_video.h |  1 -
 src/video/SDL_video.c    | 18 ------------------
 4 files changed, 7 insertions(+), 19 deletions(-)

diff --git a/WhatsNew.txt b/WhatsNew.txt
index f8cd2aaa9e3f..a0d065cc5326 100644
--- a/WhatsNew.txt
+++ b/WhatsNew.txt
@@ -31,3 +31,5 @@ General:
 * SDL_stdinc.h no longer includes stdio.h, stdlib.h, etc., it only provides the SDL C runtime functionality
 * Added SDL_CreateSurface() and SDL_CreateSurfaceFrom() which replace the SDL_CreateRGBSurface*()
 * Removed unused 'flags' parameter from SDL_ConvertSurface and SDL_ConvertSurfaceFormat
+* Removed 'SDL_GL_CONTEXT_EGL' from OpenGL configuration attributes
+
diff --git a/docs/README-migration.md b/docs/README-migration.md
index c97a445c7d3c..735d7c682ffa 100644
--- a/docs/README-migration.md
+++ b/docs/README-migration.md
@@ -234,6 +234,11 @@ SDL_SetWindowBrightness and SDL_SetWindowGammaRamp have been removed from the AP
 
 Programs which have access to shaders can implement more robust versions of those functions using custom shader code rendered as a post-process effect.
 
+
+Removed 'SDL_GL_CONTEXT_EGL' from OpenGL configuration attributes
+You can instead use 'SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);'
+
+
 ## SDL_hints.h
 
 The following hints have been removed:
diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h
index 8f811d410e65..cc1b87b41539 100644
--- a/include/SDL3/SDL_video.h
+++ b/include/SDL3/SDL_video.h
@@ -256,7 +256,6 @@ typedef enum
     SDL_GL_RETAINED_BACKING,
     SDL_GL_CONTEXT_MAJOR_VERSION,
     SDL_GL_CONTEXT_MINOR_VERSION,
-    SDL_GL_CONTEXT_EGL,
     SDL_GL_CONTEXT_FLAGS,
     SDL_GL_CONTEXT_PROFILE_MASK,
     SDL_GL_SHARE_WITH_CURRENT_CONTEXT,
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index 1f610bf3563e..38cdaea7db63 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -3565,14 +3565,6 @@ int SDL_GL_SetAttribute(SDL_GLattr attr, int value)
     case SDL_GL_CONTEXT_MINOR_VERSION:
         _this->gl_config.minor_version = value;
         break;
-    case SDL_GL_CONTEXT_EGL:
-        /* FIXME: SDL_GL_CONTEXT_EGL to be deprecated in SDL 2.1 */
-        if (value != 0) {
-            SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
-        } else {
-            SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, 0);
-        }
-        break;
     case SDL_GL_CONTEXT_FLAGS:
         if (value & ~(SDL_GL_CONTEXT_DEBUG_FLAG |
                       SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG |
@@ -3783,16 +3775,6 @@ int SDL_GL_GetAttribute(SDL_GLattr attr, int *value)
         *value = _this->gl_config.minor_version;
         return 0;
     }
-    case SDL_GL_CONTEXT_EGL:
-        /* FIXME: SDL_GL_CONTEXT_EGL to be deprecated in SDL 2.1 */
-        {
-            if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) {
-                *value = 1;
-            } else {
-                *value = 0;
-            }
-            return 0;
-        }
     case SDL_GL_CONTEXT_FLAGS:
     {
         *value = _this->gl_config.flags;