Skip to content

Commit

Permalink
Don't look for (and fail without) glGetIntegerv() until we need to.
Browse files Browse the repository at this point in the history
Fixes Bugzilla #2615.
  • Loading branch information
icculus committed May 26, 2015
1 parent 1348742 commit aba4d78
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/video/SDL_video.c
Expand Up @@ -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;
Expand All @@ -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");
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit aba4d78

Please sign in to comment.