Set GL read buffer to "front" once and for all when setting video mode
authorparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Tue, 16 Jun 2009 12:46:27 +0000 (12:46 +0000)
committerparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Tue, 16 Jun 2009 12:46:27 +0000 (12:46 +0000)
Otherwise, we keep reading the back buffer after a swap, just when its
contents could be anything.  This patch also reverts r2394 "Delay
buffer swap in level_snap until after image_snap" in favour of the
more proper fix.

git-svn-id: https://s.snth.net/svn/neverball/trunk@2886 78b8d119-cf0a-0410-b17c-f493084dd1d7

ball/set.c
share/video.c

index 1d70df0..52babe5 100644 (file)
@@ -508,10 +508,9 @@ void level_snap(int i, const char *path)
         game_kill_fade();
         game_client_step(NULL);
         game_draw(1, 0);
+        SDL_GL_SwapBuffers();
 
         image_snap(filename);
-
-        SDL_GL_SwapBuffers();
     }
 }
 
index b382585..a0a0026 100644 (file)
@@ -140,6 +140,8 @@ int video_mode(int f, int w, int h)
         }
 #endif
 
+        glReadBuffer(GL_FRONT);
+
         return 1;
     }