From 7162649f785107d5c4da21ab2bf3ab0f787fcf26 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 18 Jun 2019 18:58:39 -0400 Subject: [PATCH] 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. --- src/render/opengl/SDL_render_gl.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c index 6c09e16e9..c32f2dc16 100644 --- a/src/render/opengl/SDL_render_gl.c +++ b/src/render/opengl/SDL_render_gl.c @@ -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