Cleanups to Windows WGL_EXT_swap_control_tear code.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 01 Aug 2012 20:57:03 -0400
changeset 6383 869effc44c41
parent 6382 64d54101773a
child 6384 2fead9daad7e
Cleanups to Windows WGL_EXT_swap_control_tear code.
src/video/windows/SDL_windowsopengl.c
--- a/src/video/windows/SDL_windowsopengl.c	Wed Aug 01 20:29:36 2012 -0400
+++ b/src/video/windows/SDL_windowsopengl.c	Wed Aug 01 20:57:03 2012 -0400
@@ -611,26 +611,29 @@
 int
 WIN_GL_SetSwapInterval(_THIS, int interval)
 {
+    int retval = -1;
     if ((interval < 0) && (!_this->gl_data->HAS_WGL_EXT_swap_control_tear)) {
         SDL_SetError("Negative swap interval unsupported in this GL");
     } else if (_this->gl_data->wglSwapIntervalEXT) {
-        _this->gl_data->wglSwapIntervalEXT(interval);
-        return 0;
+        if (_this->gl_data->wglSwapIntervalEXT(interval) == TRUE) {
+            retval = 0;
+        } else {
+            WIN_SetError("wglSwapIntervalEXT()");
+        }
     } else {
         SDL_Unsupported();
-        return -1;
     }
+    return retval;
 }
 
 int
 WIN_GL_GetSwapInterval(_THIS)
 {
+    int retval = 0;
     if (_this->gl_data->wglGetSwapIntervalEXT) {
-        return _this->gl_data->wglGetSwapIntervalEXT();
-    } else {
-        /*SDL_Unsupported();*/
-        return 0;  /* just say we're unsync'd. */
+        retval = _this->gl_data->wglGetSwapIntervalEXT();
     }
+    return retval;
 }
 
 void