[AD] [WIN] overlay driver improvement

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On graphic cards that aren't able to clip overlays (like mine), when you
make the window run off the edge of the desktop, the overlay surface gets
frozen until you switch the application into the background.
This little patch corrects this poor behaviour.

--
Eric Botcazou (ebotcazou@xxxxxxxxxx)
Web Site: http://www.multimania.com/ebotcazou




--- /allegro/src/win/wddovl.c	Thu Dec  7 10:18:38 2000
+++ /allegro/src/win/wddovl.c	Thu Dec 21 18:01:28 2000
@@ -93,7 +93,7 @@
 
    _TRACE("show_overlay(%d, %d, %d, %d)\n", x, y, w, h);
 
-   overlay_visible = FALSE;
+   overlay_visible = TRUE;
 
    /* dest color keying */
    key.dwColorSpaceLowValue = 0; /* (wnd_back_color & 0xffff); */
@@ -111,12 +111,14 @@
 					 dd_prim_surface, &dest_rect,
 				     DDOVER_SHOW | DDOVER_KEYDEST, NULL);
    if (FAILED(hr)) {
+      IDirectDrawSurface_UpdateOverlay(overlay_surface, NULL,
+	 dd_prim_surface, NULL, DDOVER_HIDE, NULL);
+
       _TRACE("Can't display overlay (%x)\n", hr);
+      /* but we keep overlay_visible as TRUE to allow future updates */
       return -1;
    }
 
-   overlay_visible = TRUE;
-
    return 0;
 }
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/