d3d: Pass the superior creating object down to the callback functions.

This commit is contained in:
Markus Amsler 2006-12-03 21:52:03 +01:00 committed by Alexandre Julliard
parent 281e0f1c86
commit a60d4b2d2f
11 changed files with 50 additions and 40 deletions

View File

@ -569,26 +569,26 @@ typedef struct IDirect3DPixelShader8Impl {
* Internals functions
*
* to see how not defined it here
*/
*/
/* Callbacks */
extern HRESULT WINAPI D3D8CB_CreateSurface(IUnknown *device, UINT Width, UINT Height,
extern HRESULT WINAPI D3D8CB_CreateSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height,
WINED3DFORMAT Format, DWORD Usage, WINED3DPOOL Pool, UINT Level,
IWineD3DSurface** ppSurface, HANDLE* pSharedHandle);
extern HRESULT WINAPI D3D8CB_CreateVolume(IUnknown *pDevice, UINT Width, UINT Height, UINT Depth,
extern HRESULT WINAPI D3D8CB_CreateVolume(IUnknown *pDevice, IUnknown *pSuperior, UINT Width, UINT Height, UINT Depth,
WINED3DFORMAT Format, WINED3DPOOL Pool, DWORD Usage,
IWineD3DVolume **ppVolume,
IWineD3DVolume **ppVolume,
HANDLE * pSharedHandle);
extern HRESULT WINAPI D3D8CB_CreateDepthStencilSurface(IUnknown *device, UINT Width, UINT Height,
extern HRESULT WINAPI D3D8CB_CreateDepthStencilSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height,
WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE MultiSample,
DWORD MultisampleQuality, BOOL Discard,
IWineD3DSurface** ppSurface, HANDLE* pSharedHandle);
extern HRESULT WINAPI D3D8CB_CreateRenderTarget(IUnknown *device, UINT Width, UINT Height,
extern HRESULT WINAPI D3D8CB_CreateRenderTarget(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height,
WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE MultiSample,
DWORD MultisampleQuality, BOOL Lockable,
DWORD MultisampleQuality, BOOL Lockable,
IWineD3DSurface** ppSurface, HANDLE* pSharedHandle);
#endif /* __WINE_D3DX8_PRIVATE_H */

View File

@ -1604,7 +1604,7 @@ const IDirect3DDevice8Vtbl Direct3DDevice8_Vtbl =
};
/* Internal function called back during the CreateDevice to create a render target */
HRESULT WINAPI D3D8CB_CreateSurface(IUnknown *device, UINT Width, UINT Height,
HRESULT WINAPI D3D8CB_CreateSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height,
WINED3DFORMAT Format, DWORD Usage, WINED3DPOOL Pool, UINT Level,
IWineD3DSurface **ppSurface, HANDLE *pSharedHandle) {

View File

@ -186,9 +186,9 @@ static HMONITOR WINAPI IDirect3D8Impl_GetAdapterMonitor(LPDIRECT3D8 iface, UINT
}
/* Internal function called back during the CreateDevice to create a render target */
HRESULT WINAPI D3D8CB_CreateRenderTarget(IUnknown *device, UINT Width, UINT Height,
WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE MultiSample,
DWORD MultisampleQuality, BOOL Lockable,
HRESULT WINAPI D3D8CB_CreateRenderTarget(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height,
WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE MultiSample,
DWORD MultisampleQuality, BOOL Lockable,
IWineD3DSurface** ppSurface, HANDLE* pSharedHandle) {
HRESULT res = D3D_OK;
IDirect3DSurface8Impl *d3dSurface = NULL;
@ -267,7 +267,7 @@ static HRESULT WINAPI D3D8CB_CreateAdditionalSwapChain(IUnknown *device,
}
/* Internal function called back during the CreateDevice to create a render target */
HRESULT WINAPI D3D8CB_CreateDepthStencilSurface(IUnknown *device, UINT Width, UINT Height,
HRESULT WINAPI D3D8CB_CreateDepthStencilSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height,
WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE MultiSample,
DWORD MultisampleQuality, BOOL Discard,
IWineD3DSurface** ppSurface, HANDLE* pSharedHandle) {

View File

@ -200,7 +200,7 @@ static const IDirect3DVolume8Vtbl Direct3DVolume8_Vtbl =
/* Internal function called back during the CreateVolumeTexture */
HRESULT WINAPI D3D8CB_CreateVolume(IUnknown *pDevice, UINT Width, UINT Height, UINT Depth,
HRESULT WINAPI D3D8CB_CreateVolume(IUnknown *pDevice, IUnknown *pSuperior, UINT Width, UINT Height, UINT Depth,
WINED3DFORMAT Format, WINED3DPOOL Pool, DWORD Usage,
IWineD3DVolume **ppVolume,
HANDLE * pSharedHandle) {

View File

@ -522,23 +522,23 @@ typedef struct IDirect3DQuery9Impl {
/* Callbacks */
extern HRESULT WINAPI D3D9CB_CreateSurface(IUnknown *device, UINT Width, UINT Height,
extern HRESULT WINAPI D3D9CB_CreateSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height,
WINED3DFORMAT Format, DWORD Usage, WINED3DPOOL Pool, UINT Level,
IWineD3DSurface** ppSurface, HANDLE* pSharedHandle);
extern HRESULT WINAPI D3D9CB_CreateVolume(IUnknown *pDevice, UINT Width, UINT Height, UINT Depth,
extern HRESULT WINAPI D3D9CB_CreateVolume(IUnknown *pDevice, IUnknown *pSuperior, UINT Width, UINT Height, UINT Depth,
WINED3DFORMAT Format, WINED3DPOOL Pool, DWORD Usage,
IWineD3DVolume **ppVolume,
IWineD3DVolume **ppVolume,
HANDLE * pSharedHandle);
extern HRESULT WINAPI D3D9CB_CreateDepthStencilSurface(IUnknown *device, UINT Width, UINT Height,
extern HRESULT WINAPI D3D9CB_CreateDepthStencilSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height,
WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE MultiSample,
DWORD MultisampleQuality, BOOL Discard,
IWineD3DSurface** ppSurface, HANDLE* pSharedHandle);
extern HRESULT WINAPI D3D9CB_CreateRenderTarget(IUnknown *device, UINT Width, UINT Height,
extern HRESULT WINAPI D3D9CB_CreateRenderTarget(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height,
WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE MultiSample,
DWORD MultisampleQuality, BOOL Lockable,
DWORD MultisampleQuality, BOOL Lockable,
IWineD3DSurface** ppSurface, HANDLE* pSharedHandle);
#endif /* __WINE_D3D9_PRIVATE_H */

View File

@ -991,10 +991,10 @@ const IDirect3DDevice9Vtbl Direct3DDevice9_Vtbl =
/* Internal function called back during the CreateDevice to create a render target */
HRESULT WINAPI D3D9CB_CreateSurface(IUnknown *device, UINT Width, UINT Height,
HRESULT WINAPI D3D9CB_CreateSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height,
WINED3DFORMAT Format, DWORD Usage, WINED3DPOOL Pool, UINT Level,
IWineD3DSurface** ppSurface, HANDLE* pSharedHandle) {
HRESULT res = D3D_OK;
IDirect3DSurface9Impl *d3dSurface = NULL;
BOOL Lockable = TRUE;

View File

@ -176,7 +176,7 @@ static HMONITOR WINAPI IDirect3D9Impl_GetAdapterMonitor(LPDIRECT3D9 iface, UINT
}
/* Internal function called back during the CreateDevice to create a render target */
HRESULT WINAPI D3D9CB_CreateRenderTarget(IUnknown *device, UINT Width, UINT Height,
HRESULT WINAPI D3D9CB_CreateRenderTarget(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height,
WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE MultiSample,
DWORD MultisampleQuality, BOOL Lockable,
IWineD3DSurface** ppSurface, HANDLE* pSharedHandle) {
@ -250,7 +250,7 @@ HRESULT WINAPI D3D9CB_CreateAdditionalSwapChain(IUnknown *device,
}
/* Internal function called back during the CreateDevice to create a render target */
HRESULT WINAPI D3D9CB_CreateDepthStencilSurface(IUnknown *device, UINT Width, UINT Height,
HRESULT WINAPI D3D9CB_CreateDepthStencilSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height,
WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE MultiSample,
DWORD MultisampleQuality, BOOL Discard,
IWineD3DSurface** ppSurface, HANDLE* pSharedHandle) {

View File

@ -201,9 +201,9 @@ static const IDirect3DVolume9Vtbl Direct3DVolume9_Vtbl =
/* Internal function called back during the CreateVolumeTexture */
HRESULT WINAPI D3D9CB_CreateVolume(IUnknown *pDevice, UINT Width, UINT Height, UINT Depth,
HRESULT WINAPI D3D9CB_CreateVolume(IUnknown *pDevice, IUnknown *pSuperior, UINT Width, UINT Height, UINT Depth,
WINED3DFORMAT Format, WINED3DPOOL Pool, DWORD Usage,
IWineD3DVolume **ppVolume,
IWineD3DVolume **ppVolume,
HANDLE * pSharedHandle) {
IDirect3DVolume9Impl *object;
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)pDevice;

View File

@ -1656,6 +1656,7 @@ IDirectDrawImpl_RecreateAllSurfaces(IDirectDrawImpl *This)
*****************************************************************************/
static HRESULT WINAPI
D3D7CB_CreateSurface(IUnknown *device,
IUnknown *pSuperior,
UINT Width, UINT Height,
WINED3DFORMAT Format,
DWORD Usage, WINED3DPOOL Pool, UINT level,
@ -2640,7 +2641,8 @@ IDirectDrawImpl_EnumSurfaces(IDirectDraw7 *iface,
*
*****************************************************************************/
static HRESULT WINAPI
D3D7CB_CreateRenderTarget(IUnknown *device, UINT Width, UINT Height,
D3D7CB_CreateRenderTarget(IUnknown *device, IUnknown *pSuperior,
UINT Width, UINT Height,
WINED3DFORMAT Format,
WINED3DMULTISAMPLE_TYPE MultiSample,
DWORD MultisampleQuality,
@ -2674,6 +2676,7 @@ D3D7CB_CreateRenderTarget(IUnknown *device, UINT Width, UINT Height,
static HRESULT WINAPI
D3D7CB_CreateDepthStencilSurface(IUnknown *device,
IUnknown *pSuperior,
UINT Width,
UINT Height,
WINED3DFORMAT Format,

View File

@ -1200,7 +1200,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface, U
for (i = 0; i < object->baseTexture.levels; i++)
{
/* use the callback to create the texture surface */
hr = D3DCB_CreateSurface(This->parent, tmpW, tmpH, Format, Usage, Pool, i, &object->surfaces[i],NULL);
hr = D3DCB_CreateSurface(This->parent, parent, tmpW, tmpH, Format, Usage, Pool, i, &object->surfaces[i],NULL);
if (hr!= WINED3D_OK || ( (IWineD3DSurfaceImpl *) object->surfaces[i])->Flags & SFLAG_OVERSIZE) {
FIXME("Failed to create surface %p\n", object);
/* clean up */
@ -1277,7 +1277,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa
for (i = 0; i < object->baseTexture.levels; i++)
{
/* Create the volume */
D3DCB_CreateVolume(This->parent, Width, Height, Depth, Format, Pool, Usage,
D3DCB_CreateVolume(This->parent, parent, Width, Height, Depth, Format, Pool, Usage,
(IWineD3DVolume **)&object->volumes[i], pSharedHandle);
/* Set its container to this object */
@ -1379,7 +1379,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface
/* Create the 6 faces */
for (j = 0; j < 6; j++) {
hr=D3DCB_CreateSurface(This->parent, tmpW, tmpW, Format, Usage, Pool,
hr=D3DCB_CreateSurface(This->parent, parent, tmpW, tmpW, Format, Usage, Pool,
i /* Level */, &object->surfaces[j][i],pSharedHandle);
if(hr!= WINED3D_OK) {
@ -1725,6 +1725,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevic
TRACE("calling rendertarget CB\n");
hr = D3DCB_CreateRenderTarget((IUnknown *) This->parent,
parent,
object->presentParms.BackBufferWidth,
object->presentParms.BackBufferHeight,
object->presentParms.BackBufferFormat,
@ -1758,6 +1759,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevic
for(i = 0; i < object->presentParms.BackBufferCount; i++) {
TRACE("calling rendertarget CB\n");
hr = D3DCB_CreateRenderTarget((IUnknown *) This->parent,
parent,
object->presentParms.BackBufferWidth,
object->presentParms.BackBufferHeight,
object->presentParms.BackBufferFormat,
@ -1794,6 +1796,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevic
TRACE("Creating depth stencil buffer\n");
if (This->depthStencilBuffer == NULL ) {
hr = D3DCB_CreateDepthStencil((IUnknown *) This->parent,
parent,
object->presentParms.BackBufferWidth,
object->presentParms.BackBufferHeight,
object->presentParms.AutoDepthStencilFormat,

View File

@ -184,9 +184,10 @@ DEFINE_GUID(IID_IWineD3DQuery,
* Callback functions required for predefining surfaces / stencils
*/
typedef HRESULT WINAPI (*D3DCB_CREATERENDERTARGETFN) (IUnknown *pDevice,
UINT Width,
UINT Height,
WINED3DFORMAT Format,
IUnknown *pSuperior,
UINT Width,
UINT Height,
WINED3DFORMAT Format,
WINED3DMULTISAMPLE_TYPE MultiSample,
DWORD MultisampleQuality,
BOOL Lockable,
@ -194,7 +195,8 @@ typedef HRESULT WINAPI (*D3DCB_CREATERENDERTARGETFN) (IUnknown *pDevice,
HANDLE *pSharedHandle);
typedef HRESULT WINAPI (*D3DCB_CREATESURFACEFN) (IUnknown *pDevice,
UINT Width,
IUnknown *pSuperior,
UINT Width,
UINT Height,
WINED3DFORMAT Format,
DWORD Usage,
@ -204,9 +206,10 @@ typedef HRESULT WINAPI (*D3DCB_CREATESURFACEFN) (IUnknown *pDevice,
HANDLE *pSharedHandle);
typedef HRESULT WINAPI (*D3DCB_CREATEDEPTHSTENCILSURFACEFN) (IUnknown *pDevice,
UINT Width,
UINT Height,
WINED3DFORMAT Format,
IUnknown *pSuperior,
UINT Width,
UINT Height,
WINED3DFORMAT Format,
WINED3DMULTISAMPLE_TYPE MultiSample,
DWORD MultisampleQuality,
BOOL Discard,
@ -215,9 +218,10 @@ typedef HRESULT WINAPI (*D3DCB_CREATEDEPTHSTENCILSURFACEFN) (IUnknown *pDevice,
typedef HRESULT WINAPI (*D3DCB_CREATEVOLUMEFN) (IUnknown *pDevice,
UINT Width,
UINT Height,
UINT Depth,
IUnknown *pSuperior,
UINT Width,
UINT Height,
UINT Depth,
WINED3DFORMAT Format,
WINED3DPOOL Pool,
DWORD Usage,