From 97eddacd7aeb526c0b050c34c414f10f1cbe0a29 Mon Sep 17 00:00:00 2001
From: Cameron Cawley <[EMAIL REDACTED]>
Date: Mon, 7 Apr 2025 20:54:34 +0100
Subject: [PATCH] Use the actual value of EGL_PLATFORM_DEVICE_EXT if it's not
defined
---
src/video/SDL_egl.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/src/video/SDL_egl.c b/src/video/SDL_egl.c
index 86502549b61e7..72ad999c5d645 100644
--- a/src/video/SDL_egl.c
+++ b/src/video/SDL_egl.c
@@ -51,7 +51,12 @@
#define EGL_COLOR_COMPONENT_TYPE_EXT 0x3339
#define EGL_COLOR_COMPONENT_TYPE_FIXED_EXT 0x333A
#define EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT 0x333B
-#endif
+#endif // EGL_EXT_pixel_format_float
+
+#ifndef EGL_EXT_platform_device
+#define EGL_EXT_platform_device 1
+#define EGL_PLATFORM_DEVICE_EXT 0x313F
+#endif // EGL_EXT_platform_device
#ifndef EGL_EXT_present_opaque
#define EGL_EXT_present_opaque 1
@@ -111,13 +116,6 @@
#include <SDL3/SDL_opengl.h>
#endif
-/** If we happen to not have this defined because of an older EGL version, just define it 0x0
- as eglGetPlatformDisplayEXT will most likely be NULL if this is missing
-*/
-#ifndef EGL_PLATFORM_DEVICE_EXT
-#define EGL_PLATFORM_DEVICE_EXT 0x0
-#endif
-
#ifdef SDL_VIDEO_OPENGL
typedef void (APIENTRY* PFNGLGETINTEGERVPROC) (GLenum pname, GLint * params);
#endif