changeset 34874:9fbab723e75a

SDL swap interval fixes. Skip setting it for negative values and fix compilation with SDL 1.3.
author reimar
date Tue, 22 May 2012 21:14:55 +0000
parents f1b634f51b97
children 444a6a469743
files libvo/vo_gl.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_gl.c	Tue May 22 18:01:51 2012 +0000
+++ b/libvo/vo_gl.c	Tue May 22 21:14:55 2012 +0000
@@ -661,10 +661,14 @@
 #endif
 #ifdef CONFIG_GL_SDL
   if (glctx.type == GLTYPE_SDL) {
-#if SDL_VERSION_ATLEAST(1, 2, 10)
     // Ugly to do this here, but SDL ignores it if set later
-    SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, swap_interval);
+    if (swap_interval >= 0) {
+#if SDL_VERSION_ATLEAST(1, 3, 0)
+      SDL_GL_SetSwapInterval(swap_interval);
+#elif SDL_VERSION_ATLEAST(1, 2, 10)
+      SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, swap_interval);
 #endif
+    }
     if (!vo_sdl_config(d_width, d_height, flags, title))
         return -1;
   }