opengl: Be more robust in failing cases.

Load all possible symbols, not just until one fails, in case they get used
during shutdown, etc.

Fixes Bugzilla #4093.
This commit is contained in:
Ryan C. Gordon 2019-06-18 18:58:39 -04:00
parent 8ab907baa6
commit 7162649f78
1 changed files with 4 additions and 3 deletions

View File

@ -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;
}
@ -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