File tree Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -2093,15 +2093,31 @@ static HRESULT WINAPI d3d1_Initialize(IDirect3D *iface, REFIID riid)
2093
2093
static HRESULT WINAPI ddraw7_FlipToGDISurface (IDirectDraw7 * iface )
2094
2094
{
2095
2095
struct ddraw * ddraw = impl_from_IDirectDraw7 (iface );
2096
+ IDirectDrawSurface7 * gdi_surface ;
2097
+ struct ddraw_surface * gdi_impl ;
2098
+ HRESULT hr ;
2096
2099
2097
2100
TRACE ("iface %p.\n" , iface );
2098
2101
2099
- ddraw -> flags |= DDRAW_GDI_FLIP ;
2102
+ wined3d_mutex_lock () ;
2100
2103
2101
- if (ddraw -> primary )
2102
- ddraw_surface_update_frontbuffer (ddraw -> primary , NULL , FALSE);
2104
+ if (FAILED (hr = IDirectDraw7_GetGDISurface (iface , & gdi_surface )))
2105
+ {
2106
+ WARN ("Failed to retrieve GDI surface, hr %#x.\n" , hr );
2107
+ wined3d_mutex_unlock ();
2108
+ return hr ;
2109
+ }
2103
2110
2104
- return DD_OK ;
2111
+ gdi_impl = impl_from_IDirectDrawSurface7 (gdi_surface );
2112
+ if (gdi_impl -> surface_desc .ddsCaps .dwCaps & DDSCAPS_FRONTBUFFER )
2113
+ hr = DD_OK ;
2114
+ else
2115
+ hr = IDirectDrawSurface7_Flip (& ddraw -> primary -> IDirectDrawSurface7_iface , gdi_surface , DDFLIP_WAIT );
2116
+ IDirectDrawSurface7_Release (gdi_surface );
2117
+
2118
+ wined3d_mutex_unlock ();
2119
+
2120
+ return hr ;
2105
2121
}
2106
2122
2107
2123
static HRESULT WINAPI ddraw4_FlipToGDISurface (IDirectDraw4 * iface )
You can’t perform that action at this time.
0 commit comments