Don't look for (and fail without) glGetIntegerv() until we need to. Fixes Bugzilla #2615.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index ceda9a4..dbc3094 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -2793,7 +2793,6 @@ int
SDL_GL_GetAttribute(SDL_GLattr attr, int *value)
{
#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
- void (APIENTRY *glGetIntegervFunc) (GLenum pname, GLint * params);
GLenum (APIENTRY *glGetErrorFunc) (void);
GLenum attrib = 0;
GLenum error = 0;
@@ -2816,11 +2815,6 @@ SDL_GL_GetAttribute(SDL_GLattr attr, int *value)
}
#endif
- glGetIntegervFunc = SDL_GL_GetProcAddress("glGetIntegerv");
- if (!glGetIntegervFunc) {
- return SDL_SetError("Failed getting OpenGL glGetIntegerv entry point");
- }
-
glGetErrorFunc = SDL_GL_GetProcAddress("glGetError");
if (!glGetErrorFunc) {
return SDL_SetError("Failed getting OpenGL glGetError entry point");
@@ -3007,7 +3001,13 @@ SDL_GL_GetAttribute(SDL_GLattr attr, int *value)
} else
#endif
{
- glGetIntegervFunc(attrib, (GLint *) value);
+ void (APIENTRY *glGetIntegervFunc) (GLenum pname, GLint * params);
+ glGetIntegervFunc = SDL_GL_GetProcAddress("glGetIntegerv");
+ if (glGetIntegervFunc) {
+ glGetIntegervFunc(attrib, (GLint *) value);
+ } else {
+ return SDL_SetError("Failed getting OpenGL glGetIntegerv entry point");
+ }
}
error = glGetErrorFunc();