Oops, make "vsync 0" work again
[neverball] / share / video.c
index 0e970d7..36e626a 100644 (file)
@@ -17,6 +17,7 @@
 #include "glext.h"
 #include "config.h"
 #include "syswm.h"
+#include "sync.h"
 
 /*---------------------------------------------------------------------------*/
 
@@ -134,6 +135,11 @@ int video_mode(int f, int w, int h)
 
         glReadBuffer(GL_FRONT);
 
+        /* Attempt manual swap control if SDL's is broken. */
+
+        if (vsync && SDL_GL_GetAttribute(SDL_GL_SWAP_CONTROL, &vsync) == -1)
+            sync_init();
+
         return 1;
     }