src/video/SDL_video.c
changeset 9958 687e118144c7
parent 9931 0bb3dd1c95f2
child 9988 08d023f75d78
equal deleted inserted replaced
9957:0be86b512d34 9958:687e118144c7
  2911 #if SDL_VIDEO_OPENGL
  2911 #if SDL_VIDEO_OPENGL
  2912     const GLubyte *(APIENTRY *glGetStringFunc) (GLenum name);
  2912     const GLubyte *(APIENTRY *glGetStringFunc) (GLenum name);
  2913     void (APIENTRY *glGetFramebufferAttachmentParameterivFunc) (GLenum target, GLenum attachment, GLenum pname, GLint* params);
  2913     void (APIENTRY *glGetFramebufferAttachmentParameterivFunc) (GLenum target, GLenum attachment, GLenum pname, GLint* params);
  2914     GLenum attachment = GL_BACK_LEFT;
  2914     GLenum attachment = GL_BACK_LEFT;
  2915     GLenum attachmentattrib = 0;
  2915     GLenum attachmentattrib = 0;
  2916 
  2916 #endif
  2917     glGetStringFunc = SDL_GL_GetProcAddress("glGetString");
       
  2918     if (!glGetStringFunc) {
       
  2919         return SDL_SetError("Failed getting OpenGL glGetString entry point");
       
  2920     }
       
  2921 #endif
       
  2922 
       
  2923     glGetErrorFunc = SDL_GL_GetProcAddress("glGetError");
       
  2924     if (!glGetErrorFunc) {
       
  2925         return SDL_SetError("Failed getting OpenGL glGetError entry point");
       
  2926     }
       
  2927 
  2917 
  2928     /* Clear value in any case */
  2918     /* Clear value in any case */
  2929     *value = 0;
  2919     *value = 0;
  2930 
  2920 
  2931     switch (attr) {
  2921     switch (attr) {
  3093     default:
  3083     default:
  3094         return SDL_SetError("Unknown OpenGL attribute");
  3084         return SDL_SetError("Unknown OpenGL attribute");
  3095     }
  3085     }
  3096 
  3086 
  3097 #if SDL_VIDEO_OPENGL
  3087 #if SDL_VIDEO_OPENGL
       
  3088     glGetStringFunc = SDL_GL_GetProcAddress("glGetString");
       
  3089     if (!glGetStringFunc) {
       
  3090         return SDL_SetError("Failed getting OpenGL glGetString entry point");
       
  3091     }
       
  3092 
  3098     if (attachmentattrib && isAtLeastGL3((const char *) glGetStringFunc(GL_VERSION))) {
  3093     if (attachmentattrib && isAtLeastGL3((const char *) glGetStringFunc(GL_VERSION))) {
  3099         glGetFramebufferAttachmentParameterivFunc = SDL_GL_GetProcAddress("glGetFramebufferAttachmentParameteriv");
  3094         glGetFramebufferAttachmentParameterivFunc = SDL_GL_GetProcAddress("glGetFramebufferAttachmentParameteriv");
  3100 
  3095 
  3101         if (glGetFramebufferAttachmentParameterivFunc) {
  3096         if (glGetFramebufferAttachmentParameterivFunc) {
  3102             glGetFramebufferAttachmentParameterivFunc(GL_FRAMEBUFFER, attachment, attachmentattrib, (GLint *) value);
  3097             glGetFramebufferAttachmentParameterivFunc(GL_FRAMEBUFFER, attachment, attachmentattrib, (GLint *) value);
  3111         if (glGetIntegervFunc) {
  3106         if (glGetIntegervFunc) {
  3112             glGetIntegervFunc(attrib, (GLint *) value);
  3107             glGetIntegervFunc(attrib, (GLint *) value);
  3113         } else {
  3108         } else {
  3114             return SDL_SetError("Failed getting OpenGL glGetIntegerv entry point");
  3109             return SDL_SetError("Failed getting OpenGL glGetIntegerv entry point");
  3115         }
  3110         }
       
  3111     }
       
  3112 
       
  3113     glGetErrorFunc = SDL_GL_GetProcAddress("glGetError");
       
  3114     if (!glGetErrorFunc) {
       
  3115         return SDL_SetError("Failed getting OpenGL glGetError entry point");
  3116     }
  3116     }
  3117 
  3117 
  3118     error = glGetErrorFunc();
  3118     error = glGetErrorFunc();
  3119     if (error != GL_NO_ERROR) {
  3119     if (error != GL_NO_ERROR) {
  3120         if (error == GL_INVALID_ENUM) {
  3120         if (error == GL_INVALID_ENUM) {