src/video/x11/SDL_x11opengl.c
changeset 5630 39e74dab5ebb
parent 5573 7dd4caf23bf5
child 5981 75caa8a7d559
     1.1 --- a/src/video/x11/SDL_x11opengl.c	Sun Aug 21 12:36:55 2011 -0400
     1.2 +++ b/src/video/x11/SDL_x11opengl.c	Mon Aug 22 02:26:11 2011 -0400
     1.3 @@ -265,7 +265,7 @@
     1.4      /* Check for GLX_EXT_swap_control */
     1.5      if (HasExtension("GLX_EXT_swap_control", extensions)) {
     1.6          _this->gl_data->glXSwapIntervalEXT =
     1.7 -            (void (*)(Display*,GLXDrawable,int))
     1.8 +            (int (*)(Display*,GLXDrawable,int))
     1.9                  X11_GL_GetProcAddress(_this, "glXSwapIntervalEXT");
    1.10      }
    1.11  
    1.12 @@ -538,9 +538,13 @@
    1.13          const SDL_WindowData *windowdata = (SDL_WindowData *)
    1.14              _this->current_glwin->driverdata;
    1.15          Window drawable = windowdata->xwindow;
    1.16 -        _this->gl_data->glXSwapIntervalEXT(display, drawable, interval);
    1.17 -        status = 0;  /* always succeeds, apparently. */
    1.18 -        swapinterval = interval;
    1.19 +        status = _this->gl_data->glXSwapIntervalEXT(display,drawable,interval);
    1.20 +        if (status != 0) {
    1.21 +            SDL_SetError("glxSwapIntervalEXT failed");
    1.22 +            status = -1;
    1.23 +        } else {
    1.24 +            swapinterval = interval;
    1.25 +        }
    1.26      } else if (_this->gl_data->glXSwapIntervalMESA) {
    1.27          status = _this->gl_data->glXSwapIntervalMESA(interval);
    1.28          if (status != 0) {