Commit fad3f9ba authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Basic overlay emulation with opengl.

parent e795d842
......@@ -1378,6 +1378,11 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) {
unlock_end:
This->Flags &= ~SFLAG_LOCKED;
memset(&This->lockedRect, 0, sizeof(RECT));
/* Overlays have to be redrawn manually after changes with the GL implementation */
if(This->overlay_dest) {
IWineD3DSurface_DrawOverlay(iface);
}
return WINED3D_OK;
}
......@@ -3338,6 +3343,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *
/* Activate the destination context, set it up for blitting */
myDevice->activeContext->last_was_blit = FALSE;
ActivateContext(myDevice, (IWineD3DSurface *) This, CTXUSAGE_BLIT);
if(!dstSwapchain) {
......@@ -4452,6 +4458,20 @@ static WINED3DSURFTYPE WINAPI IWineD3DSurfaceImpl_GetImplType(IWineD3DSurface *i
return SURFACE_OPENGL;
}
static HRESULT WINAPI IWineD3DSurfaceImpl_DrawOverlay(IWineD3DSurface *iface) {
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
HRESULT hr;
/* If there's no destination surface there is nothing to do */
if(!This->overlay_dest) return WINED3D_OK;
hr = IWineD3DSurfaceImpl_Blt((IWineD3DSurface *) This->overlay_dest, &This->overlay_destrect,
iface, &This->overlay_srcrect, WINEDDBLT_WAIT,
NULL, WINED3DTEXF_LINEAR);
return hr;
}
const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl =
{
/* IUnknown */
......@@ -4508,5 +4528,6 @@ const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl =
IWineD3DSurfaceImpl_PrivateSetup,
IWineD3DSurfaceImpl_ModifyLocation,
IWineD3DSurfaceImpl_LoadLocation,
IWineD3DSurfaceImpl_GetImplType
IWineD3DSurfaceImpl_GetImplType,
IWineD3DSurfaceImpl_DrawOverlay
};
......@@ -374,6 +374,8 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetOverlayPosition(IWineD3DSurface *iface
This->overlay_destrect.right = X + w;
This->overlay_destrect.bottom = Y + h;
IWineD3DSurface_DrawOverlay(iface);
return WINED3D_OK;
}
......@@ -419,7 +421,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_UpdateOverlayZOrder(IWineD3DSurface *ifac
HRESULT WINAPI IWineD3DBaseSurfaceImpl_UpdateOverlay(IWineD3DSurface *iface, RECT *SrcRect, IWineD3DSurface *DstSurface, RECT *DstRect, DWORD Flags, WINEDDOVERLAYFX *FX) {
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
IWineD3DSurfaceImpl *Dst = (IWineD3DSurfaceImpl *) DstSurface;
FIXME("(%p)->(%p, %p, %p, %08x, %p)\n", This, SrcRect, Dst, DstRect, Flags, FX);
TRACE("(%p)->(%p, %p, %p, %08x, %p)\n", This, SrcRect, Dst, DstRect, Flags, FX);
if(!(This->resource.usage & WINED3DUSAGE_OVERLAY))
{
......@@ -460,6 +462,8 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_UpdateOverlay(IWineD3DSurface *iface, REC
This->overlay_dest = NULL;
}
IWineD3DSurface_DrawOverlay(iface);
return WINED3D_OK;
}
......
......@@ -801,6 +801,11 @@ static WINED3DSURFTYPE WINAPI IWineGDISurfaceImpl_GetImplType(IWineD3DSurface *i
return SURFACE_GDI;
}
static HRESULT WINAPI IWineGDISurfaceImpl_DrawOverlay(IWineD3DSurface *iface) {
FIXME("GDI surfaces can't draw overlays yet\n");
return E_FAIL;
}
/* FIXME: This vtable should not use any IWineD3DSurface* implementation functions,
* only IWineD3DBaseSurface and IWineGDISurface ones.
*/
......@@ -860,5 +865,6 @@ const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl =
IWineGDISurfaceImpl_PrivateSetup,
IWineGDISurfaceImpl_ModifyLocation,
IWineGDISurfaceImpl_LoadLocation,
IWineGDISurfaceImpl_GetImplType
IWineGDISurfaceImpl_GetImplType,
IWineGDISurfaceImpl_DrawOverlay
};
......@@ -1175,6 +1175,7 @@ DECLARE_INTERFACE_(IWineD3DSurface,IWineD3DResource)
STDMETHOD_(void,ModifyLocation)(THIS_ DWORD flag, BOOL persistent);
STDMETHOD(LoadLocation)(THIS_ DWORD flag, const RECT *rect);
STDMETHOD_(WINED3DSURFTYPE,GetImplType)(THIS);
STDMETHOD(DrawOverlay)(THIS);
};
#undef INTERFACE
......@@ -1235,6 +1236,7 @@ DECLARE_INTERFACE_(IWineD3DSurface,IWineD3DResource)
#define IWineD3DSurface_ModifyLocation(p,a,b) (p)->lpVtbl->ModifyLocation(p,a,b)
#define IWineD3DSurface_LoadLocation(p,a,b) (p)->lpVtbl->LoadLocation(p,a,b)
#define IWineD3DSurface_GetImplType(p) (p)->lpVtbl->GetImplType(p)
#define IWineD3DSurface_DrawOverlay(p) (p)->lpVtbl->DrawOverlay(p)
#endif
/*****************************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment