src/video/SDL_video.c
changeset 9958 687e118144c7
parent 9931 0bb3dd1c95f2
child 9988 08d023f75d78
     1.1 --- a/src/video/SDL_video.c	Wed Dec 09 21:34:56 2015 -0500
     1.2 +++ b/src/video/SDL_video.c	Thu Dec 10 20:25:34 2015 -0400
     1.3 @@ -2913,18 +2913,8 @@
     1.4      void (APIENTRY *glGetFramebufferAttachmentParameterivFunc) (GLenum target, GLenum attachment, GLenum pname, GLint* params);
     1.5      GLenum attachment = GL_BACK_LEFT;
     1.6      GLenum attachmentattrib = 0;
     1.7 -
     1.8 -    glGetStringFunc = SDL_GL_GetProcAddress("glGetString");
     1.9 -    if (!glGetStringFunc) {
    1.10 -        return SDL_SetError("Failed getting OpenGL glGetString entry point");
    1.11 -    }
    1.12  #endif
    1.13  
    1.14 -    glGetErrorFunc = SDL_GL_GetProcAddress("glGetError");
    1.15 -    if (!glGetErrorFunc) {
    1.16 -        return SDL_SetError("Failed getting OpenGL glGetError entry point");
    1.17 -    }
    1.18 -
    1.19      /* Clear value in any case */
    1.20      *value = 0;
    1.21  
    1.22 @@ -3095,6 +3085,11 @@
    1.23      }
    1.24  
    1.25  #if SDL_VIDEO_OPENGL
    1.26 +    glGetStringFunc = SDL_GL_GetProcAddress("glGetString");
    1.27 +    if (!glGetStringFunc) {
    1.28 +        return SDL_SetError("Failed getting OpenGL glGetString entry point");
    1.29 +    }
    1.30 +
    1.31      if (attachmentattrib && isAtLeastGL3((const char *) glGetStringFunc(GL_VERSION))) {
    1.32          glGetFramebufferAttachmentParameterivFunc = SDL_GL_GetProcAddress("glGetFramebufferAttachmentParameteriv");
    1.33  
    1.34 @@ -3115,6 +3110,11 @@
    1.35          }
    1.36      }
    1.37  
    1.38 +    glGetErrorFunc = SDL_GL_GetProcAddress("glGetError");
    1.39 +    if (!glGetErrorFunc) {
    1.40 +        return SDL_SetError("Failed getting OpenGL glGetError entry point");
    1.41 +    }
    1.42 +
    1.43      error = glGetErrorFunc();
    1.44      if (error != GL_NO_ERROR) {
    1.45          if (error == GL_INVALID_ENUM) {