opengl: Don't try to do Desktop OpenGL stuff if support isn't available.

This commit is contained in:
Ryan C. Gordon 2020-04-13 22:06:12 -04:00
parent a96d8a4355
commit 132f87c3a1
1 changed files with 3 additions and 1 deletions

View File

@ -975,9 +975,10 @@ SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface)
if (SDL_GL_ExtensionSupported("GL_OES_surfaceless_context")) { if (SDL_GL_ExtensionSupported("GL_OES_surfaceless_context")) {
_this->gl_allow_no_surface = SDL_TRUE; _this->gl_allow_no_surface = SDL_TRUE;
} }
#if SDL_VIDEO_OPENGL
} else { } else {
/* Desktop OpenGL supports it by default from version 3.0 on. */ /* 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"); glGetIntegervFunc = SDL_GL_GetProcAddress("glGetIntegerv");
if (glGetIntegervFunc) { if (glGetIntegervFunc) {
GLint v = 0; GLint v = 0;
@ -986,6 +987,7 @@ SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface)
_this->gl_allow_no_surface = SDL_TRUE; _this->gl_allow_no_surface = SDL_TRUE;
} }
} }
#endif
} }
} }