flush pipeline in WMesaSwapBuffers (Frank Warmerdam)
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 26 Apr 2001 19:14:35 +0000 (19:14 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 26 Apr 2001 19:14:35 +0000 (19:14 +0000)
src/mesa/drivers/windows/wmesa.c

index ff256e266ede440e7369bdede848ce9de86f3d4f..581106cb4f85f9ae423005f2eb73080be1f92a5b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: wmesa.c,v 1.14 2001/03/03 20:33:29 brianp Exp $ */
+/* $Id: wmesa.c,v 1.15 2001/04/26 19:14:35 brianp Exp $ */
 
 /*
  * Windows (Win32) device driver for Mesa 3.4
@@ -1368,6 +1368,14 @@ void /*APIENTRY*/ WMesaMakeCurrent( WMesaContext c )
 void /*APIENTRY*/ WMesaSwapBuffers( void )
 {
     HDC DC = Current->hDC;
+    GET_CURRENT_CONTEXT(ctx);
+
+    /* If we're swapping the buffer associated with the current context
+     * we have to flush any pending rendering commands first.
+    */
+    if (Current && Current->gl_ctx == ctx)
+       _mesa_swapbuffers(ctx);
+
     if (Current->db_flag)
         wmFlush(Current);
 }