]> git.sesse.net Git - vlc/commitdiff
Allocated a direct3d back buffer as large as the whole virtual screen.
authorLaurent Aimar <fenrir@videolan.org>
Mon, 21 Dec 2009 17:47:27 +0000 (18:47 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Mon, 21 Dec 2009 17:48:42 +0000 (18:48 +0100)
It will allow to resize the video on multiple monitors.

modules/video_output/msw/direct3d.c

index 970f3a3f3f6699412dc5b1874d8f16bc6b72af17..f04368d25638b068a42c3a549f2a89167884a787 100644 (file)
@@ -515,8 +515,10 @@ static int Direct3DFillPresentationParameters(vout_display_t *vd)
     d3dpp->Flags                  = D3DPRESENTFLAG_VIDEO;
     d3dpp->Windowed               = TRUE;
     d3dpp->hDeviceWindow          = vd->sys->hvideownd;
-    d3dpp->BackBufferWidth        = d3ddm.Width;
-    d3dpp->BackBufferHeight       = d3ddm.Height;
+    d3dpp->BackBufferWidth        = __MAX(GetSystemMetrics(SM_CXVIRTUALSCREEN),
+                                          d3ddm.Width);
+    d3dpp->BackBufferHeight       = __MAX(GetSystemMetrics(SM_CYVIRTUALSCREEN),
+                                          d3ddm.Height);
     d3dpp->SwapEffect             = D3DSWAPEFFECT_COPY;
     d3dpp->MultiSampleType        = D3DMULTISAMPLE_NONE;
     d3dpp->PresentationInterval   = D3DPRESENT_INTERVAL_DEFAULT;
@@ -524,15 +526,6 @@ static int Direct3DFillPresentationParameters(vout_display_t *vd)
     d3dpp->BackBufferCount        = 1;
     d3dpp->EnableAutoDepthStencil = FALSE;
 
-    const unsigned adapter_count = IDirect3D9_GetAdapterCount(sys->d3dobj);
-    for (unsigned i = 1; i < adapter_count; i++) {
-        hr = IDirect3D9_GetAdapterDisplayMode(sys->d3dobj, i, &d3ddm);
-        if (FAILED(hr))
-            continue;
-        d3dpp->BackBufferWidth  = __MAX(d3dpp->BackBufferWidth,  d3ddm.Width);
-        d3dpp->BackBufferHeight = __MAX(d3dpp->BackBufferHeight, d3ddm.Height);
-    }
-
     /* */
     RECT *display = &vd->sys->rect_display;
     display->left   = 0;