WineD3D: Add WINED3DUSAGE_OVERLAY

Vitaliy Margolen wine-devel at kievinfo.com
Thu Oct 5 19:23:02 CDT 2006


Stefan Dösinger wrote:
> D3D9 does not have Overlay surfaces like ddraw does, so we need a 
> wined3d-private way to create ddraw overlays. I decided to add a new usage 
> flag outside of the flags defined by Direct3D and use it in wined3d. d3d8 and 
> d3d9 have to filter usage flags which are not valid in d3d8 and d3d9 to 
> prevent broken applications from accidentally passing WINED3DUSAGE_OVERLAY.
> 
> D3D9 does not need overlays, because dynamic textures + drawing textured quads 
> can provide simmilar functionality. But it is hard to implement ddraw ovelays 
> using dynamic textures in ddraw.dll in an efficient way, so I decided to 
> implement overlays in the ddraw way in wined3d.
> 
> 
> @@ -274,7 +274,7 @@ static HRESULT  WINAPI IDirect3DDevice9I
>      
>      TRACE("(%p) : w(%d) h(%d) fmt(%d) surf@%p\n", This, Width, Height, Format, *ppSurface);
>             
> -    hrc = IWineD3DDevice_CreateSurface(This->WineD3DDevice, Width, Height, Format, Lockable, Discard, Level,  &object->wineD3DSurface, Type, Usage, (WINED3DPOOL) Pool,MultiSample,MultisampleQuality,pSharedHandle,SURFACE_OPENGL,(IUnknown *)object);
> +    hrc = IWineD3DDevice_CreateSurface(This->WineD3DDevice, Width, Height, Format, Lockable, Discard, Level,  &object->wineD3DSurface, Type, Usage & WINED3DUSAGE_MASK, (WINED3DPOOL) Pool,MultiSample,MultisampleQuality,pSharedHandle,SURFACE_OPENGL,(IUnknown *)object);
>      
Should we split lines like this? It's doesn't fit even on my 1600x1200
display.

> diff --git a/include/wine/wined3d_types.h b/include/wine/wined3d_types.h
> index e70a814..278e7d7 100644
> --- a/include/wine/wined3d_types.h
> +++ b/include/wine/wined3d_types.h
> @@ -1053,6 +1053,7 @@ #define WINED3DUSAGE_DYNAMIC            
>  #define WINED3DUSAGE_AUTOGENMIPMAP                    0x00000400L 
>  #define WINED3DUSAGE_DMAP                             0x00004000L
>  #define WINED3DUSAGE_MASK                             0x00004FFFL
> +#define WINED3DUSAGE_OVERLAY                          0x00010000L
>  

I think it would be safer to make it 0x10000000L instead.

Vitaliy



More information about the wine-devel mailing list