opengl: Be more robust in failing cases.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 18 Jun 2019 18:58:39 -0400
changeset 12887b8d437d42151
parent 12886 6f8f744a09dc
child 12888 3dd2f2634e46
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
     1.1 --- a/src/render/opengl/SDL_render_gl.c	Tue Jun 18 14:24:26 2019 -0700
     1.2 +++ b/src/render/opengl/SDL_render_gl.c	Tue Jun 18 18:58:39 2019 -0400
     1.3 @@ -178,7 +178,7 @@
     1.4              data->errors = 0;
     1.5              data->error_messages = NULL;
     1.6          }
     1.7 -    } else {
     1.8 +    } else if (data->glGetError != NULL) {
     1.9          while (data->glGetError() != GL_NO_ERROR) {
    1.10              continue;
    1.11          }
    1.12 @@ -234,18 +234,19 @@
    1.13  #ifdef __SDL_NOGETPROCADDR__
    1.14  #define SDL_PROC(ret,func,params) data->func=func;
    1.15  #else
    1.16 +    int retval = 0;
    1.17  #define SDL_PROC(ret,func,params) \
    1.18      do { \
    1.19          data->func = SDL_GL_GetProcAddress(#func); \
    1.20          if ( ! data->func ) { \
    1.21 -            return SDL_SetError("Couldn't load GL function %s: %s", #func, SDL_GetError()); \
    1.22 +            retval = SDL_SetError("Couldn't load GL function %s: %s", #func, SDL_GetError()); \
    1.23          } \
    1.24      } while ( 0 );
    1.25  #endif /* __SDL_NOGETPROCADDR__ */
    1.26  
    1.27  #include "SDL_glfuncs.h"
    1.28  #undef SDL_PROC
    1.29 -    return 0;
    1.30 +    return retval;
    1.31  }
    1.32  
    1.33  static int