Skip to content

Commit

Permalink
opengl: Be more robust in failing cases.
Browse files Browse the repository at this point in the history
Load all possible symbols, not just until one fails, in case they get used
during shutdown, etc.

Fixes Bugzilla #4093.
  • Loading branch information
icculus committed Jun 18, 2019
1 parent 8ab907b commit 7162649
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/render/opengl/SDL_render_gl.c
Expand Up @@ -178,7 +178,7 @@ GL_ClearErrors(SDL_Renderer *renderer)
data->errors = 0;
data->error_messages = NULL;
}
} else {
} else if (data->glGetError != NULL) {
while (data->glGetError() != GL_NO_ERROR) {
continue;
}
Expand Down Expand Up @@ -234,18 +234,19 @@ GL_LoadFunctions(GL_RenderData * data)
#ifdef __SDL_NOGETPROCADDR__
#define SDL_PROC(ret,func,params) data->func=func;
#else
int retval = 0;
#define SDL_PROC(ret,func,params) \
do { \
data->func = SDL_GL_GetProcAddress(#func); \
if ( ! data->func ) { \
return SDL_SetError("Couldn't load GL function %s: %s", #func, SDL_GetError()); \
retval = SDL_SetError("Couldn't load GL function %s: %s", #func, SDL_GetError()); \
} \
} while ( 0 );
#endif /* __SDL_NOGETPROCADDR__ */

#include "SDL_glfuncs.h"
#undef SDL_PROC
return 0;
return retval;
}

static int
Expand Down

0 comments on commit 7162649

Please sign in to comment.