src/video/x11/SDL_x11opengl.c
changeset 5630 39e74dab5ebb
parent 5573 7dd4caf23bf5
child 5981 75caa8a7d559
equal deleted inserted replaced
5625:0a9b94c0613c 5630:39e74dab5ebb
   263     }
   263     }
   264 
   264 
   265     /* Check for GLX_EXT_swap_control */
   265     /* Check for GLX_EXT_swap_control */
   266     if (HasExtension("GLX_EXT_swap_control", extensions)) {
   266     if (HasExtension("GLX_EXT_swap_control", extensions)) {
   267         _this->gl_data->glXSwapIntervalEXT =
   267         _this->gl_data->glXSwapIntervalEXT =
   268             (void (*)(Display*,GLXDrawable,int))
   268             (int (*)(Display*,GLXDrawable,int))
   269                 X11_GL_GetProcAddress(_this, "glXSwapIntervalEXT");
   269                 X11_GL_GetProcAddress(_this, "glXSwapIntervalEXT");
   270     }
   270     }
   271 
   271 
   272     /* Check for GLX_MESA_swap_control */
   272     /* Check for GLX_MESA_swap_control */
   273     if (HasExtension("GLX_MESA_swap_control", extensions)) {
   273     if (HasExtension("GLX_MESA_swap_control", extensions)) {
   536     if (_this->gl_data->glXSwapIntervalEXT) {
   536     if (_this->gl_data->glXSwapIntervalEXT) {
   537         Display *display = ((SDL_VideoData *) _this->driverdata)->display;
   537         Display *display = ((SDL_VideoData *) _this->driverdata)->display;
   538         const SDL_WindowData *windowdata = (SDL_WindowData *)
   538         const SDL_WindowData *windowdata = (SDL_WindowData *)
   539             _this->current_glwin->driverdata;
   539             _this->current_glwin->driverdata;
   540         Window drawable = windowdata->xwindow;
   540         Window drawable = windowdata->xwindow;
   541         _this->gl_data->glXSwapIntervalEXT(display, drawable, interval);
   541         status = _this->gl_data->glXSwapIntervalEXT(display,drawable,interval);
   542         status = 0;  /* always succeeds, apparently. */
   542         if (status != 0) {
   543         swapinterval = interval;
   543             SDL_SetError("glxSwapIntervalEXT failed");
       
   544             status = -1;
       
   545         } else {
       
   546             swapinterval = interval;
       
   547         }
   544     } else if (_this->gl_data->glXSwapIntervalMESA) {
   548     } else if (_this->gl_data->glXSwapIntervalMESA) {
   545         status = _this->gl_data->glXSwapIntervalMESA(interval);
   549         status = _this->gl_data->glXSwapIntervalMESA(interval);
   546         if (status != 0) {
   550         if (status != 0) {
   547             SDL_SetError("glxSwapIntervalMESA failed");
   551             SDL_SetError("glxSwapIntervalMESA failed");
   548             status = -1;
   552             status = -1;