From 132f87c3a142b36527573cf4c4191d90451c95bb Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <icculus@icculus.org>
Date: Mon, 13 Apr 2020 22:06:12 -0400
Subject: [PATCH] opengl: Don't try to do Desktop OpenGL stuff if support isn't
 available.

---
 src/video/SDL_egl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/video/SDL_egl.c b/src/video/SDL_egl.c
index 5a90fc183..58939053c 100644
--- a/src/video/SDL_egl.c
+++ b/src/video/SDL_egl.c
@@ -975,9 +975,10 @@ SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface)
             if (SDL_GL_ExtensionSupported("GL_OES_surfaceless_context")) {
                 _this->gl_allow_no_surface = SDL_TRUE;
             }
+#if SDL_VIDEO_OPENGL
         } else {
             /* Desktop OpenGL supports it by default from version 3.0 on. */
-            void (GL_APIENTRY * glGetIntegervFunc) (GLenum pname, GLint * params);
+            void (APIENTRY * glGetIntegervFunc) (GLenum pname, GLint * params);
             glGetIntegervFunc = SDL_GL_GetProcAddress("glGetIntegerv");
             if (glGetIntegervFunc) {
                 GLint v = 0;
@@ -986,6 +987,7 @@ SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface)
                     _this->gl_allow_no_surface = SDL_TRUE;
                 }
             }
+#endif
         }
     }