From 08f49bd2d3847e48a79e817136f9e35834b72243 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 22 Aug 2011 02:26:11 -0400 Subject: [PATCH] Apparently glXSwapIntervalEXT() _does_ return a value. Revision 6 of the GLX_EXT_swap_control spec has a typo; the function signature they list is void, but the docs talk about a return value, and the glxext.h headers list "int". --- src/video/x11/SDL_x11opengl.c | 12 ++++++++---- src/video/x11/SDL_x11opengl.h | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/video/x11/SDL_x11opengl.c b/src/video/x11/SDL_x11opengl.c index 96f5079ac..49ed345ea 100644 --- a/src/video/x11/SDL_x11opengl.c +++ b/src/video/x11/SDL_x11opengl.c @@ -265,7 +265,7 @@ X11_GL_InitExtensions(_THIS) /* Check for GLX_EXT_swap_control */ if (HasExtension("GLX_EXT_swap_control", extensions)) { _this->gl_data->glXSwapIntervalEXT = - (void (*)(Display*,GLXDrawable,int)) + (int (*)(Display*,GLXDrawable,int)) X11_GL_GetProcAddress(_this, "glXSwapIntervalEXT"); } @@ -538,9 +538,13 @@ X11_GL_SetSwapInterval(_THIS, int interval) const SDL_WindowData *windowdata = (SDL_WindowData *) _this->current_glwin->driverdata; Window drawable = windowdata->xwindow; - _this->gl_data->glXSwapIntervalEXT(display, drawable, interval); - status = 0; /* always succeeds, apparently. */ - swapinterval = interval; + status = _this->gl_data->glXSwapIntervalEXT(display,drawable,interval); + if (status != 0) { + SDL_SetError("glxSwapIntervalEXT failed"); + status = -1; + } else { + swapinterval = interval; + } } else if (_this->gl_data->glXSwapIntervalMESA) { status = _this->gl_data->glXSwapIntervalMESA(interval); if (status != 0) { diff --git a/src/video/x11/SDL_x11opengl.h b/src/video/x11/SDL_x11opengl.h index 730566446..cb5cb3d9c 100644 --- a/src/video/x11/SDL_x11opengl.h +++ b/src/video/x11/SDL_x11opengl.h @@ -38,7 +38,7 @@ struct SDL_GLDriverData Bool(*glXMakeCurrent) (Display*,GLXDrawable,GLXContext); void (*glXSwapBuffers) (Display*, GLXDrawable); void (*glXQueryDrawable) (Display*,GLXDrawable,int,unsigned int*); - void (*glXSwapIntervalEXT) (Display*,GLXDrawable,int); + int (*glXSwapIntervalEXT) (Display*,GLXDrawable,int); int (*glXSwapIntervalSGI) (int); int (*glXSwapIntervalMESA) (int); int (*glXGetSwapIntervalMESA) (void);