}
*surface = texture->wined3d_surface;
+ IWineD3DSurface_AddRef(*surface);
+ ID3D10Texture2D_Release((ID3D10Texture2D *)texture);
return S_OK;
}
}
*surface = texture->wined3d_surface;
+ IWineD3DSurface_AddRef(*surface);
+ ID3D10Texture2D_Release((ID3D10Texture2D *)texture);
return S_OK;
}
}
*surface = texture->wined3d_surface;
+ IWineD3DSurface_AddRef(*surface);
+ ID3D10Texture2D_Release((ID3D10Texture2D *)texture);
return S_OK;
}
TRACE("%p increasing refcount to %u\n", This, refcount);
+ if (refcount == 1 && This->wined3d_surface) IWineD3DSurface_AddRef(This->wined3d_surface);
+
return refcount;
}
+static void STDMETHODCALLTYPE d3d10_texture2d_wined3d_object_released(void *parent)
+{
+ struct d3d10_texture2d *This = parent;
+
+ if (This->dxgi_surface) IDXGISurface_Release(This->dxgi_surface);
+ HeapFree(GetProcessHeap(), 0, This);
+}
+
static ULONG STDMETHODCALLTYPE d3d10_texture2d_Release(ID3D10Texture2D *iface)
{
struct d3d10_texture2d *This = (struct d3d10_texture2d *)iface;
if (!refcount)
{
- if (This->dxgi_surface) IDXGISurface_Release(This->dxgi_surface);
if (This->wined3d_surface) IWineD3DSurface_Release(This->wined3d_surface);
- HeapFree(GetProcessHeap(), 0, This);
+ else d3d10_texture2d_wined3d_object_released(This);
}
return refcount;
d3d10_texture2d_GetDesc,
};
+static const struct wined3d_parent_ops d3d10_texture2d_wined3d_parent_ops =
+{
+ d3d10_texture2d_wined3d_object_released,
+};
+
HRESULT d3d10_texture2d_init(struct d3d10_texture2d *texture, struct d3d10_device *device,
const D3D10_TEXTURE2D_DESC *desc)
{
wined3dformat_from_dxgi_format(desc->Format), FALSE, FALSE, 0,
&texture->wined3d_surface, desc->Usage, WINED3DPOOL_DEFAULT,
desc->SampleDesc.Count > 1 ? desc->SampleDesc.Count : WINED3DMULTISAMPLE_NONE,
- desc->SampleDesc.Quality, SURFACE_OPENGL, (IUnknown *)texture);
+ desc->SampleDesc.Quality, SURFACE_OPENGL, (IUnknown *)texture,
+ &d3d10_texture2d_wined3d_parent_ops);
if (FAILED(hr))
{
ERR("CreateSurface failed, returning %#x\n", hr);
TRACE("Releasing child %p\n", This->wineD3DCubeTexture);
wined3d_mutex_lock();
- IWineD3DCubeTexture_Destroy(This->wineD3DCubeTexture, D3D8CB_DestroySurface);
+ IWineD3DCubeTexture_Destroy(This->wineD3DCubeTexture);
wined3d_mutex_unlock();
IUnknown_Release(This->parentDevice);
/* If set forward refcounting to this object */
IUnknown *forwardReference;
-
- /* Flags an implicit surface */
- BOOL isImplicit;
};
HRESULT surface_init(IDirect3DSurface8Impl *surface, IDirect3DDevice8Impl *device,
/* Callbacks */
extern ULONG WINAPI D3D8CB_DestroySwapChain (IWineD3DSwapChain *pSwapChain);
-extern ULONG WINAPI D3D8CB_DestroyDepthStencilSurface (IWineD3DSurface *pSurface);
-extern ULONG WINAPI D3D8CB_DestroyRenderTarget (IWineD3DSurface *pSurface);
-extern ULONG WINAPI D3D8CB_DestroySurface(IWineD3DSurface *pSurface);
extern ULONG WINAPI D3D8CB_DestroyVolume(IWineD3DVolume *pVolume);
#endif /* __WINE_D3DX8_PRIVATE_H */
}
HeapFree(GetProcessHeap(), 0, This->decls);
- IWineD3DDevice_Uninit3D(This->WineD3DDevice, D3D8CB_DestroyDepthStencilSurface, D3D8CB_DestroySwapChain);
+ IWineD3DDevice_Uninit3D(This->WineD3DDevice, D3D8CB_DestroySwapChain);
IWineD3DDevice_Release(This->WineD3DDevice);
HeapFree(GetProcessHeap(), 0, This->handle_table.entries);
HeapFree(GetProcessHeap(), 0, This);
IDirect3DDevice8Impl_DeletePatch
};
-ULONG WINAPI D3D8CB_DestroySurface(IWineD3DSurface *pSurface) {
- IDirect3DSurface8Impl* surfaceParent;
- TRACE("(%p) call back\n", pSurface);
-
- IWineD3DSurface_GetParent(pSurface, (IUnknown **) &surfaceParent);
- /* GetParent's AddRef was forwarded to an object in destruction.
- * Releasing it here again would cause an endless recursion. */
- surfaceParent->forwardReference = NULL;
- return IDirect3DSurface8_Release((IDirect3DSurface8*) surfaceParent);
-}
-
/* IWineD3DDeviceParent IUnknown methods */
static inline struct IDirect3DDevice8Impl *device_from_device_parent(IWineD3DDeviceParent *iface)
}
*surface = d3d_surface->wineD3DSurface;
+ IWineD3DSurface_AddRef(*surface);
+
d3d_surface->container = superior;
IUnknown_Release(d3d_surface->parentDevice);
d3d_surface->parentDevice = NULL;
+
+ IDirect3DSurface8_Release((IDirect3DSurface8 *)d3d_surface);
d3d_surface->forwardReference = superior;
return hr;
}
*surface = d3d_surface->wineD3DSurface;
+ IWineD3DSurface_AddRef(*surface);
+
d3d_surface->container = (IUnknown *)This;
- d3d_surface->isImplicit = TRUE;
/* Implicit surfaces are created with an refcount of 0 */
IUnknown_Release((IUnknown *)d3d_surface);
}
*surface = d3d_surface->wineD3DSurface;
+ IWineD3DSurface_AddRef(*surface);
+
d3d_surface->container = (IUnknown *)This;
- d3d_surface->isImplicit = TRUE;
/* Implicit surfaces are created with an refcount of 0 */
IUnknown_Release((IUnknown *)d3d_surface);
return ret;
}
-ULONG WINAPI D3D8CB_DestroyRenderTarget(IWineD3DSurface *pSurface) {
- IDirect3DSurface8Impl* surfaceParent;
- TRACE("(%p) call back\n", pSurface);
-
- IWineD3DSurface_GetParent(pSurface, (IUnknown **) &surfaceParent);
- surfaceParent->isImplicit = FALSE;
- /* Surface had refcount of 0 GetParent addrefed to 1, so 1 Release is enough */
- return IDirect3DSurface8_Release((IDirect3DSurface8*) surfaceParent);
-}
-
ULONG WINAPI D3D8CB_DestroySwapChain(IWineD3DSwapChain *pSwapChain) {
IUnknown* swapChainParent;
TRACE("(%p) call back\n", pSwapChain);
return IUnknown_Release(swapChainParent);
}
-ULONG WINAPI D3D8CB_DestroyDepthStencilSurface(IWineD3DSurface *pSurface) {
- IDirect3DSurface8Impl* surfaceParent;
- TRACE("(%p) call back\n", pSurface);
-
- IWineD3DSurface_GetParent(pSurface, (IUnknown **) &surfaceParent);
- surfaceParent->isImplicit = FALSE;
- /* Surface had refcount of 0 GetParent addrefed to 1, so 1 Release is enough */
- return IDirect3DSurface8_Release((IDirect3DSurface8*) surfaceParent);
-}
-
static HRESULT WINAPI IDirect3D8Impl_CreateDevice(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow,
DWORD BehaviourFlags, D3DPRESENT_PARAMETERS* pPresentationParameters,
IDirect3DDevice8** ppReturnedDeviceInterface) {
} else {
/* No container, handle our own refcounting */
ULONG ref = InterlockedIncrement(&This->ref);
- if(ref == 1 && This->parentDevice) IUnknown_AddRef(This->parentDevice);
+ if (ref == 1)
+ {
+ if (This->parentDevice) IUnknown_AddRef(This->parentDevice);
+ wined3d_mutex_lock();
+ IUnknown_AddRef(This->wineD3DSurface);
+ wined3d_mutex_unlock();
+ }
TRACE("(%p) : AddRef from %d\n", This, ref - 1);
return ref;
}
if (ref == 0) {
if (This->parentDevice) IUnknown_Release(This->parentDevice);
/* Implicit surfaces are destroyed with the device, not if refcount reaches 0. */
- if (!This->isImplicit) {
- wined3d_mutex_lock();
- IWineD3DSurface_Release(This->wineD3DSurface);
- wined3d_mutex_unlock();
-
- HeapFree(GetProcessHeap(), 0, This);
- }
+ wined3d_mutex_lock();
+ IWineD3DSurface_Release(This->wineD3DSurface);
+ wined3d_mutex_unlock();
}
return ref;
IDirect3DSurface8Impl_UnlockRect
};
+static void STDMETHODCALLTYPE surface_wined3d_object_destroyed(void *parent)
+{
+ HeapFree(GetProcessHeap(), 0, parent);
+}
+
+static const struct wined3d_parent_ops d3d8_surface_wined3d_parent_ops =
+{
+ surface_wined3d_object_destroyed,
+};
+
HRESULT surface_init(IDirect3DSurface8Impl *surface, IDirect3DDevice8Impl *device,
UINT width, UINT height, D3DFORMAT format, BOOL lockable, BOOL discard, UINT level,
DWORD usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality)
wined3d_mutex_lock();
hr = IWineD3DDevice_CreateSurface(device->WineD3DDevice, width, height, wined3dformat_from_d3dformat(format),
lockable, discard, level, &surface->wineD3DSurface, usage & WINED3DUSAGE_MASK, (WINED3DPOOL)pool,
- multisample_type, multisample_quality, SURFACE_OPENGL, (IUnknown *)surface);
+ multisample_type, multisample_quality, SURFACE_OPENGL, (IUnknown *)surface,
+ &d3d8_surface_wined3d_parent_ops);
wined3d_mutex_unlock();
if (FAILED(hr))
{
if (ref == 0) {
wined3d_mutex_lock();
- IWineD3DSwapChain_Destroy(This->wineD3DSwapChain, D3D8CB_DestroyRenderTarget);
+ IWineD3DSwapChain_Destroy(This->wineD3DSwapChain);
wined3d_mutex_unlock();
if (This->parentDevice) IUnknown_Release(This->parentDevice);
if (ref == 0) {
wined3d_mutex_lock();
- IWineD3DTexture_Destroy(This->wineD3DTexture, D3D8CB_DestroySurface);
+ IWineD3DTexture_Destroy(This->wineD3DTexture);
wined3d_mutex_unlock();
IUnknown_Release(This->parentDevice);
TRACE("Releasing child %p\n", This->wineD3DCubeTexture);
wined3d_mutex_lock();
- IWineD3DCubeTexture_Destroy(This->wineD3DCubeTexture, D3D9CB_DestroySurface);
+ IWineD3DCubeTexture_Destroy(This->wineD3DCubeTexture);
IDirect3DDevice9Ex_Release(This->parentDevice);
wined3d_mutex_unlock();
/* If set forward refcounting to this object */
IUnknown *forwardReference;
- /* Flags an implicit surface */
- BOOL isImplicit;
-
BOOL getdc_supported;
} IDirect3DSurface9Impl;
/* Callbacks */
extern ULONG WINAPI D3D9CB_DestroySwapChain (IWineD3DSwapChain *pSwapChain);
-extern ULONG WINAPI D3D9CB_DestroyDepthStencilSurface (IWineD3DSurface *pSurface);
-extern ULONG WINAPI D3D9CB_DestroyRenderTarget (IWineD3DSurface *pSurface);
-extern ULONG WINAPI D3D9CB_DestroySurface(IWineD3DSurface *pSurface);
extern ULONG WINAPI D3D9CB_DestroyVolume(IWineD3DVolume *pVolume);
#endif /* __WINE_D3D9_PRIVATE_H */
}
HeapFree(GetProcessHeap(), 0, This->convertedDecls);
- IWineD3DDevice_Uninit3D(This->WineD3DDevice, D3D9CB_DestroyDepthStencilSurface, D3D9CB_DestroySwapChain);
+ IWineD3DDevice_Uninit3D(This->WineD3DDevice, D3D9CB_DestroySwapChain);
IWineD3DDevice_Release(This->WineD3DDevice);
wined3d_mutex_unlock();
IDirect3DDevice9ExImpl_GetDisplayModeEx
};
-ULONG WINAPI D3D9CB_DestroySurface(IWineD3DSurface *pSurface) {
- IDirect3DSurface9Impl* surfaceParent;
- TRACE("(%p) call back\n", pSurface);
-
- IWineD3DSurface_GetParent(pSurface, (IUnknown **) &surfaceParent);
- /* GetParent's AddRef was forwarded to an object in destruction.
- * Releasing it here again would cause an endless recursion. */
- surfaceParent->forwardReference = NULL;
- return IDirect3DSurface9_Release((IDirect3DSurface9*) surfaceParent);
-}
-
/* IWineD3DDeviceParent IUnknown methods */
static inline struct IDirect3DDevice9Impl *device_from_device_parent(IWineD3DDeviceParent *iface)
}
*surface = d3d_surface->wineD3DSurface;
+ IWineD3DSurface_AddRef(*surface);
+
d3d_surface->container = superior;
IDirect3DDevice9Ex_Release(d3d_surface->parentDevice);
d3d_surface->parentDevice = NULL;
+
+ IDirect3DSurface9_Release((IDirect3DSurface9 *)d3d_surface);
d3d_surface->forwardReference = superior;
return hr;
}
*surface = d3d_surface->wineD3DSurface;
+ IWineD3DSurface_AddRef(*surface);
+
d3d_surface->container = superior;
- d3d_surface->isImplicit = TRUE;
/* Implicit surfaces are created with an refcount of 0 */
IDirect3DSurface9_Release((IDirect3DSurface9 *)d3d_surface);
}
*surface = d3d_surface->wineD3DSurface;
+ IWineD3DSurface_AddRef(*surface);
d3d_surface->container = (IUnknown *)This;
- d3d_surface->isImplicit = TRUE;
/* Implicit surfaces are created with an refcount of 0 */
IDirect3DSurface9_Release((IDirect3DSurface9 *)d3d_surface);
return ret;
}
-ULONG WINAPI D3D9CB_DestroyRenderTarget(IWineD3DSurface *pSurface) {
- IDirect3DSurface9Impl* surfaceParent;
- TRACE("(%p) call back\n", pSurface);
-
- IWineD3DSurface_GetParent(pSurface, (IUnknown **) &surfaceParent);
- surfaceParent->isImplicit = FALSE;
- /* Surface had refcount of 0 GetParent addrefed to 1, so 1 Release is enough */
- return IDirect3DSurface9_Release((IDirect3DSurface9*) surfaceParent);
-}
-
ULONG WINAPI D3D9CB_DestroySwapChain(IWineD3DSwapChain *pSwapChain) {
IDirect3DSwapChain9Impl* swapChainParent;
TRACE("(%p) call back\n", pSwapChain);
return IDirect3DSwapChain9_Release((IDirect3DSwapChain9*) swapChainParent);
}
-ULONG WINAPI D3D9CB_DestroyDepthStencilSurface(IWineD3DSurface *pSurface) {
- IDirect3DSurface9Impl* surfaceParent;
- TRACE("(%p) call back\n", pSurface);
-
- IWineD3DSurface_GetParent(pSurface, (IUnknown **) &surfaceParent);
- surfaceParent->isImplicit = FALSE;
- /* Surface had refcount of 0 GetParent addrefed to 1, so 1 Release is enough */
- return IDirect3DSurface9_Release((IDirect3DSurface9*) surfaceParent);
-}
-
static HRESULT WINAPI IDirect3D9Impl_CreateDevice(LPDIRECT3D9EX iface, UINT Adapter, D3DDEVTYPE DeviceType,
HWND hFocusWindow, DWORD BehaviourFlags,
D3DPRESENT_PARAMETERS* pPresentationParameters,
} else {
/* No container, handle our own refcounting */
ULONG ref = InterlockedIncrement(&This->ref);
- if(ref == 1 && This->parentDevice) IDirect3DDevice9Ex_AddRef(This->parentDevice);
+ if (ref == 1)
+ {
+ if (This->parentDevice) IDirect3DDevice9Ex_AddRef(This->parentDevice);
+ wined3d_mutex_lock();
+ IWineD3DSurface_AddRef(This->wineD3DSurface);
+ wined3d_mutex_unlock();
+ }
TRACE("(%p) : AddRef from %d\n", This, ref - 1);
return ref;
if (ref == 0) {
if (This->parentDevice) IDirect3DDevice9Ex_Release(This->parentDevice);
- if (!This->isImplicit) {
- wined3d_mutex_lock();
- IWineD3DSurface_Release(This->wineD3DSurface);
- wined3d_mutex_unlock();
-
- HeapFree(GetProcessHeap(), 0, This);
- }
+ wined3d_mutex_lock();
+ IWineD3DSurface_Release(This->wineD3DSurface);
+ wined3d_mutex_unlock();
}
return ref;
IDirect3DSurface9Impl_ReleaseDC
};
+static void STDMETHODCALLTYPE surface_wined3d_object_destroyed(void *parent)
+{
+ HeapFree(GetProcessHeap(), 0, parent);
+}
+
+static const struct wined3d_parent_ops d3d9_surface_wined3d_parent_ops =
+{
+ surface_wined3d_object_destroyed,
+};
+
HRESULT surface_init(IDirect3DSurface9Impl *surface, IDirect3DDevice9Impl *device,
UINT width, UINT height, D3DFORMAT format, BOOL lockable, BOOL discard, UINT level,
DWORD usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality)
wined3d_mutex_lock();
hr = IWineD3DDevice_CreateSurface(device->WineD3DDevice, width, height, wined3dformat_from_d3dformat(format),
lockable, discard, level, &surface->wineD3DSurface, usage & WINED3DUSAGE_MASK, (WINED3DPOOL)pool,
- multisample_type, multisample_quality, SURFACE_OPENGL, (IUnknown *)surface);
+ multisample_type, multisample_quality, SURFACE_OPENGL, (IUnknown *)surface,
+ &d3d9_surface_wined3d_parent_ops);
wined3d_mutex_unlock();
if (FAILED(hr))
{
if (This->parentDevice) IDirect3DDevice9Ex_Release(This->parentDevice);
if (!This->isImplicit) {
wined3d_mutex_lock();
- IWineD3DSwapChain_Destroy(This->wineD3DSwapChain, D3D9CB_DestroyRenderTarget);
+ IWineD3DSwapChain_Destroy(This->wineD3DSwapChain);
wined3d_mutex_unlock();
HeapFree(GetProcessHeap(), 0, This);
if (ref == 0) {
wined3d_mutex_lock();
- IWineD3DTexture_Destroy(This->wineD3DTexture, D3D9CB_DestroySurface);
+ IWineD3DTexture_Destroy(This->wineD3DTexture);
wined3d_mutex_unlock();
IDirect3DDevice9Ex_Release(This->parentDevice);
0
};
+static void STDMETHODCALLTYPE ddraw_null_wined3d_object_destroyed(void *parent) {}
+
+static const struct wined3d_parent_ops ddraw_null_wined3d_parent_ops =
+{
+ ddraw_null_wined3d_object_destroyed,
+};
+
/*****************************************************************************
* IUnknown Methods
*****************************************************************************/
IDirectDrawSurfaceImpl *surfImpl = (IDirectDrawSurfaceImpl *)surf;
IDirectDrawImpl *This = surfImpl->ddraw;
IUnknown *Parent;
- IParentImpl *parImpl = NULL;
IWineD3DSurface *wineD3DSurface;
IWineD3DSwapChain *swapchain;
HRESULT hr;
- void *tmp;
IWineD3DClipper *clipper = NULL;
WINED3DSURFACE_DESC Desc;
swapchain = surfImpl->wineD3DSwapChain;
surfImpl->wineD3DSwapChain = NULL;
wineD3DSurface = surfImpl->WineD3DSurface;
- IWineD3DSurface_GetParent(wineD3DSurface, &Parent);
- IUnknown_Release(Parent); /* For the getParent */
-
- /* Is the parent an IParent interface? */
- if(IUnknown_QueryInterface(Parent, &IID_IParent, &tmp) == S_OK)
- {
- /* It is a IParent interface! */
- IUnknown_Release(Parent); /* For the QueryInterface */
- parImpl = (IParentImpl *)Parent;
- /* Release the reference the parent interface is holding */
- IWineD3DSurface_Release(wineD3DSurface);
- }
/* get the clipper */
IWineD3DSurface_GetClipper(wineD3DSurface, &clipper);
Width = Desc.width;
Height = Desc.height;
- if(swapchain) {
- /* If there's a swapchain, it owns the IParent interface. Create a new one for the
- * new surface
- */
- parImpl = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*parImpl));
- parImpl->lpVtbl = &IParent_Vtbl;
- parImpl->ref = 1;
-
- Parent = (IUnknown *) parImpl;
- }
+ IWineD3DSurface_GetParent(wineD3DSurface, &Parent);
/* Create the new surface */
hr = IWineD3DDevice_CreateSurface(This->wineD3DDevice, Width, Height, Format,
- TRUE /* Lockable */, FALSE /* Discard */, surfImpl->mipmap_level, &surfImpl->WineD3DSurface,
- Usage, Pool, MultiSampleType, MultiSampleQuality, This->ImplType, Parent);
+ TRUE /* Lockable */, FALSE /* Discard */, surfImpl->mipmap_level, &surfImpl->WineD3DSurface, Usage, Pool,
+ MultiSampleType, MultiSampleQuality, This->ImplType, Parent, &ddraw_null_wined3d_parent_ops);
+ IUnknown_Release(Parent);
if(hr != D3D_OK)
return hr;
IWineD3DSurface_SetClipper(surfImpl->WineD3DSurface, clipper);
- /* Update the IParent if it exists */
- if(parImpl)
- {
- parImpl->child = (IUnknown *) surfImpl->WineD3DSurface;
- /* Add a reference for the IParent */
- IWineD3DSurface_AddRef(surfImpl->WineD3DSurface);
- }
/* TODO: Copy the surface content, except for render targets */
/* If there's a swapchain, it owns the wined3d surfaces. So Destroy
/* Should happen almost never */
FIXME("(%p) Switching to non-opengl surfaces with d3d started. Is this a bug?\n", This);
/* Shutdown d3d */
- IWineD3DDevice_Uninit3D(This->wineD3DDevice, D3D7CB_DestroyDepthStencilSurface, D3D7CB_DestroySwapChain);
+ IWineD3DDevice_Uninit3D(This->wineD3DDevice, D3D7CB_DestroySwapChain);
}
/* Contrary: D3D starting is handled by the caller, because it knows the render target */
return IUnknown_Release(swapChainParent);
}
-ULONG WINAPI D3D7CB_DestroyDepthStencilSurface(IWineD3DSurface *pSurface) {
- IUnknown* surfaceParent;
- TRACE("(%p) call back\n", pSurface);
-
- IWineD3DSurface_GetParent(pSurface, &surfaceParent);
- IUnknown_Release(surfaceParent);
- return IUnknown_Release(surfaceParent);
-}
-
/*****************************************************************************
* IDirectDrawImpl_CreateNewSurface
*
DWORD Usage = 0;
WINED3DSURFTYPE ImplType = This->ImplType;
WINED3DSURFACE_DESC Desc;
- IUnknown *Parent;
- IParentImpl *parImpl = NULL;
WINED3DPOOL Pool = WINED3DPOOL_DEFAULT;
if (TRACE_ON(ddraw))
/* A trace message for debugging */
TRACE("(%p) Created IDirectDrawSurface implementation structure at %p\n", This, *ppSurf);
- if(pDDSD->ddsCaps.dwCaps & ( DDSCAPS_PRIMARYSURFACE | DDSCAPS_TEXTURE | DDSCAPS_3DDEVICE) )
- {
- /* Render targets and textures need a IParent interface,
- * because WineD3D will destroy them when the swapchain
- * is released
- */
- parImpl = HeapAlloc(GetProcessHeap(), 0, sizeof(IParentImpl));
- if(!parImpl)
- {
- ERR("Out of memory when allocating memory for a IParent implementation\n");
- return DDERR_OUTOFMEMORY;
- }
- parImpl->ref = 1;
- parImpl->lpVtbl = &IParent_Vtbl;
- Parent = (IUnknown *)parImpl;
- TRACE("Using IParent interface %p as parent\n", parImpl);
- }
- else
- {
- /* Use the surface as parent */
- Parent = (IUnknown *)*ppSurf;
- TRACE("Using Surface interface %p as parent\n", *ppSurf);
- }
-
/* Now create the WineD3D Surface */
hr = IWineD3DDevice_CreateSurface(This->wineD3DDevice, pDDSD->dwWidth, pDDSD->dwHeight, Format,
TRUE /* Lockable */, FALSE /* Discard */, level, &(*ppSurf)->WineD3DSurface,
- Usage, Pool, WINED3DMULTISAMPLE_NONE, 0 /* MultiSampleQuality */, ImplType, Parent);
+ Usage, Pool, WINED3DMULTISAMPLE_NONE, 0 /* MultiSampleQuality */, ImplType,
+ (IUnknown *)*ppSurf, &ddraw_null_wined3d_parent_ops);
if(hr != D3D_OK)
{
return hr;
}
- /* Set the child of the parent implementation if it exists */
- if(parImpl)
- {
- parImpl->child = (IUnknown *) (*ppSurf)->WineD3DSurface;
- /* The IParent releases the WineD3DSurface, and
- * the ddraw surface does that too. Hold a reference
- */
- IWineD3DSurface_AddRef((*ppSurf)->WineD3DSurface);
- }
-
/* Increase the surface counter, and attach the surface */
InterlockedIncrement(&This->surfaces);
list_add_head(&This->surface_list, &(*ppSurf)->surface_list_entry);
{
ERR("Error allocating an array for the converted vertex decls\n");
This->declArraySize = 0;
- hr = IWineD3DDevice_Uninit3D(This->wineD3DDevice,
- D3D7CB_DestroyDepthStencilSurface,
- D3D7CB_DestroySwapChain);
+ hr = IWineD3DDevice_Uninit3D(This->wineD3DDevice, D3D7CB_DestroySwapChain);
return E_OUTOFMEMORY;
}
/* Return the surface */
*surface = surf->WineD3DSurface;
+ IWineD3DSurface_AddRef(*surface);
TRACE("Returning wineD3DSurface %p, it belongs to surface %p\n", *surface, surf);
/* TODO: Return failure if the dimensions do not match, but this shouldn't happen */
*surface = target->WineD3DSurface;
+ IWineD3DSurface_AddRef(*surface);
target->isRenderTarget = TRUE;
TRACE("Returning wineD3DSurface %p, it belongs to surface %p\n", *surface, d3d_surface);
DWORD multisample_quality, BOOL discard, IWineD3DSurface **surface)
{
struct IDirectDrawImpl *This = ddraw_from_device_parent(iface);
- /* Create a Depth Stencil surface to make WineD3D happy */
+ IDirectDrawSurfaceImpl *ddraw_surface;
DDSURFACEDESC2 ddsd;
HRESULT hr;
}
This->depthstencil = TRUE;
- hr = IDirectDraw7_CreateSurface((IDirectDraw7 *)This,
- &ddsd, (IDirectDrawSurface7 **)&This->DepthStencilBuffer, NULL);
+ hr = IDirectDraw7_CreateSurface((IDirectDraw7 *)This, &ddsd, (IDirectDrawSurface7 **)&ddraw_surface, NULL);
This->depthstencil = FALSE;
if(FAILED(hr))
{
return hr;
}
- *surface = This->DepthStencilBuffer->WineD3DSurface;
+ *surface = ddraw_surface->WineD3DSurface;
+ IWineD3DSurface_AddRef(*surface);
+ IDirectDrawSurface7_Release((IDirectDrawSurface7 *)ddraw_surface);
return D3D_OK;
}
/* Callbacks for implicit object destruction */
extern ULONG WINAPI D3D7CB_DestroySwapChain(IWineD3DSwapChain *pSwapChain);
-extern ULONG WINAPI D3D7CB_DestroyDepthStencilSurface(IWineD3DSurface *pSurface);
-
/* Global critical section */
extern CRITICAL_SECTION ddraw_cs;
/* WineD3D linkage */
IWineD3D *wineD3D;
IWineD3DDevice *wineD3DDevice;
- IDirectDrawSurfaceImpl *DepthStencilBuffer;
BOOL d3d_initialized;
/* Misc ddraw fields */
void *context)
{
IDirectDrawSurfaceImpl *Impl = (IDirectDrawSurfaceImpl *)surf;
- IDirectDrawImpl *ddraw = context;
ULONG ref;
ref = IDirectDrawSurface7_Release(surf); /* For the EnumSurfaces */
*/
if( (!Impl->is_complex_root) || (Impl->first_attached != Impl) )
return DDENUMRET_OK;
- /* Skip our depth stencil surface, it will be released with the render target */
- if( Impl == ddraw->DepthStencilBuffer)
- return DDENUMRET_OK;
/* Destroy the surface */
while(ref) ref = IDirectDrawSurface7_Release(surf);
IDirectDrawSurfaceImpl *This = (IDirectDrawSurfaceImpl *)iface;
ULONG refCount = InterlockedIncrement(&This->ref);
+ if (refCount == 1 && This->WineD3DSurface)
+ {
+ EnterCriticalSection(&ddraw_cs);
+ IWineD3DSurface_AddRef(This->WineD3DSurface);
+ LeaveCriticalSection(&ddraw_cs);
+ }
+
TRACE("(%p) : AddRef increasing from %d\n", This, refCount - 1);
return refCount;
}
HeapFree(GetProcessHeap(), 0, ddraw->decls);
ddraw->numConvertedDecls = 0;
- if(IWineD3DDevice_Uninit3D(ddraw->wineD3DDevice, D3D7CB_DestroyDepthStencilSurface, D3D7CB_DestroySwapChain) != D3D_OK)
+ if (FAILED(IWineD3DDevice_Uninit3D(ddraw->wineD3DDevice, D3D7CB_DestroySwapChain)))
{
/* Not good */
ERR("(%p) Failed to uninit 3D\n", This);
return refcount;
}
-static ULONG STDMETHODCALLTYPE destroy_surface(IWineD3DSurface *surface)
-{
- IDXGISurface *dxgi_surface;
-
- TRACE("surface %p\n", surface);
-
- IWineD3DSurface_GetParent(surface, (IUnknown **)&dxgi_surface);
- IDXGISurface_Release(dxgi_surface);
-
- return IDXGISurface_Release(dxgi_surface);
-}
-
static ULONG STDMETHODCALLTYPE destroy_swapchain(IWineD3DSwapChain *swapchain)
{
TRACE("swapchain %p\n", swapchain);
}
else
{
- hr = IWineD3DDevice_Uninit3D(wined3d_device, destroy_surface, destroy_swapchain);
+ hr = IWineD3DDevice_Uninit3D(wined3d_device, destroy_swapchain);
IWineD3DDevice_Release(wined3d_device);
if (FAILED(hr))
{
*dirty = FALSE;
}
-static void cubetexture_cleanup(IWineD3DCubeTextureImpl *This, D3DCB_DESTROYSURFACEFN surface_destroy_cb)
+static void cubetexture_cleanup(IWineD3DCubeTextureImpl *This)
{
unsigned int i, j;
surface_set_texture_name(surface, 0, FALSE);
surface_set_texture_target(surface, 0);
IWineD3DSurface_SetContainer(surface, NULL);
- surface_destroy_cb(surface);
+ IWineD3DSurface_Release(surface);
}
}
}
{
FIXME("(%p) Failed to create surface, hr %#x.\n", texture, hr);
texture->surfaces[j][i] = NULL;
- cubetexture_cleanup(texture, D3DCB_DefaultDestroySurface);
+ cubetexture_cleanup(texture);
return hr;
}
TRACE("(%p) : Releasing from %d\n", This, This->resource.ref);
ref = InterlockedDecrement(&This->resource.ref);
if (ref == 0) {
- IWineD3DCubeTexture_Destroy(iface, D3DCB_DefaultDestroySurface);
+ IWineD3DCubeTexture_Destroy(iface);
}
return ref;
}
/* *******************************************
IWineD3DCubeTexture IWineD3DCubeTexture parts follow
******************************************* */
-static void WINAPI IWineD3DCubeTextureImpl_Destroy(IWineD3DCubeTexture *iface, D3DCB_DESTROYSURFACEFN D3DCB_DestroySurface) {
+static void WINAPI IWineD3DCubeTextureImpl_Destroy(IWineD3DCubeTexture *iface)
+{
IWineD3DCubeTextureImpl *This = (IWineD3DCubeTextureImpl *)iface;
- cubetexture_cleanup(This, D3DCB_DestroySurface);
+ cubetexture_cleanup(This);
/* finally delete the object */
HeapFree(GetProcessHeap(), 0, This);
}
static HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, UINT Width, UINT Height,
WINED3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, IWineD3DSurface **ppSurface,
DWORD Usage, WINED3DPOOL Pool, WINED3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality,
- WINED3DSURFTYPE Impl, IUnknown *parent)
+ WINED3DSURFTYPE Impl, IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
{
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
IWineD3DSurfaceImpl *object;
}
hr = surface_init(object, Impl, This->surface_alignment, Width, Height, Level, Lockable,
- Discard, MultiSample, MultisampleQuality, This, Usage, Format, Pool, parent);
+ Discard, MultiSample, MultisampleQuality, This, Usage, Format, Pool, parent, parent_ops);
if (FAILED(hr))
{
WARN("Failed to initialize surface, returning %#x.\n", hr);
HDC hDc;
IWineD3DSwapChainImpl *object; /** NOTE: impl ref allowed since this is a create function **/
HRESULT hr;
- IUnknown *bufferParent;
BOOL displaymode_set = FALSE;
WINED3DDISPLAYMODE Mode;
const struct GlPixelFormatDesc *format_desc;
if (object->backBuffer) {
UINT i;
for(i = 0; i < object->presentParms.BackBufferCount; i++) {
- if(object->backBuffer[i]) {
- IWineD3DSurface_GetParent(object->backBuffer[i], &bufferParent);
- IUnknown_Release(bufferParent); /* once for the get parent */
- if (IUnknown_Release(bufferParent) > 0) {
- FIXME("(%p) Something's still holding the back buffer\n",This);
- }
- }
+ if (object->backBuffer[i]) IWineD3DSurface_Release(object->backBuffer[i]);
}
HeapFree(GetProcessHeap(), 0, object->backBuffer);
object->backBuffer = NULL;
}
if(object->context && object->context[0])
DestroyContext(This, object->context[0]);
- if(object->frontBuffer) {
- IWineD3DSurface_GetParent(object->frontBuffer, &bufferParent);
- IUnknown_Release(bufferParent); /* once for the get parent */
- if (IUnknown_Release(bufferParent) > 0) {
- FIXME("(%p) Something's still holding the front buffer\n",This);
- }
- }
+ if (object->frontBuffer) IWineD3DSurface_Release(object->frontBuffer);
HeapFree(GetProcessHeap(), 0, object);
return hr;
}
}
hr = IWineD3DDevice_CreateSurface((IWineD3DDevice *) This, bm.bmWidth, bm.bmHeight, WINED3DFMT_R5G6B5, TRUE,
- FALSE, 0, &This->logo_surface, 0, WINED3DPOOL_DEFAULT, WINED3DMULTISAMPLE_NONE, 0, SURFACE_OPENGL, NULL);
+ FALSE, 0, &This->logo_surface, 0, WINED3DPOOL_DEFAULT, WINED3DMULTISAMPLE_NONE, 0, SURFACE_OPENGL,
+ NULL, &wined3d_null_parent_ops);
if(FAILED(hr)) {
ERR("Wine logo requested, but failed to create surface\n");
goto out;
return WINED3D_OK;
}
-static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface, D3DCB_DESTROYSURFACEFN D3DCB_DestroyDepthStencilSurface, D3DCB_DESTROYSWAPCHAINFN D3DCB_DestroySwapChain) {
+static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface,
+ D3DCB_DESTROYSWAPCHAINFN D3DCB_DestroySwapChain)
+{
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface;
int sampler;
UINT i;
This->render_targets[0] = NULL;
if (This->auto_depth_stencil_buffer) {
- if(D3DCB_DestroyDepthStencilSurface(This->auto_depth_stencil_buffer) > 0) {
+ if (IWineD3DSurface_Release(This->auto_depth_stencil_buffer) > 0)
+ {
FIXME("(%p) Something's still holding the auto depth stencil buffer\n", This);
}
This->auto_depth_stencil_buffer = NULL;
* Copyright 2004 Christian Costa
* Copyright 2005 Oliver Stieber
* Copyright 2007-2008 Stefan Dösinger for CodeWeavers
+ * Copyright 2009 Henri Verbeet for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
return WINED3D_OK;
}
-ULONG WINAPI D3DCB_DefaultDestroySurface(IWineD3DSurface *pSurface) {
- IUnknown* surfaceParent;
- TRACE("(%p) call back\n", pSurface);
-
- /* Now, release the parent, which will take care of cleaning up the surface for us */
- IWineD3DSurface_GetParent(pSurface, &surfaceParent);
- IUnknown_Release(surfaceParent);
- return IUnknown_Release(surfaceParent);
-}
-
ULONG WINAPI D3DCB_DefaultDestroyVolume(IWineD3DVolume *pVolume) {
IUnknown* volumeParent;
TRACE("(%p) call back\n", pVolume);
IWineD3DImpl_GetDeviceCaps,
IWineD3DImpl_CreateDevice
};
+
+static void STDMETHODCALLTYPE wined3d_null_wined3d_object_destroyed(void *parent) {}
+
+const struct wined3d_parent_ops wined3d_null_parent_ops =
+{
+ wined3d_null_wined3d_object_destroyed,
+};
* Copyright 2006-2008 Stefan Dösinger for CodeWeavers
* Copyright 2007-2008 Henri Verbeet
* Copyright 2006-2008 Roderick Colenbrander
+ * Copyright 2009 Henri Verbeet for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
HRESULT surface_init(IWineD3DSurfaceImpl *surface, WINED3DSURFTYPE surface_type, UINT alignment,
UINT width, UINT height, UINT level, BOOL lockable, BOOL discard, WINED3DMULTISAMPLE_TYPE multisample_type,
UINT multisample_quality, IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format,
- WINED3DPOOL pool, IUnknown *parent)
+ WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, &GLINFO_LOCATION);
return hr;
}
+ surface->parent_ops = parent_ops;
+
/* "Standalone" surface. */
IWineD3DSurface_SetContainer((IWineD3DSurface *)surface, NULL);
if (!ref)
{
surface_cleanup(This);
+ This->parent_ops->wined3d_object_destroyed(This->resource.parent);
TRACE("(%p) Released.\n", This);
HeapFree(GetProcessHeap(), 0, This);
* Copyright 2006-2008 Stefan Dösinger for CodeWeavers
* Copyright 2007 Henri Verbeet
* Copyright 2006-2007 Roderick Colenbrander
+ * Copyright 2009 Henri Verbeet for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
IWineD3DDevice_CreateSurface((IWineD3DDevice *)source->resource.wineD3DDevice, source->currentDesc.Width,
source->currentDesc.Height, to_fmt, TRUE /* lockable */, TRUE /* discard */, 0 /* level */, &ret,
0 /* usage */, WINED3DPOOL_SCRATCH, WINED3DMULTISAMPLE_NONE /* TODO: Multisampled conversion */,
- 0 /* MultiSampleQuality */, IWineD3DSurface_GetImplType((IWineD3DSurface *) source), NULL /* parent */);
+ 0 /* MultiSampleQuality */, IWineD3DSurface_GetImplType((IWineD3DSurface *) source),
+ NULL /* parent */, &wined3d_null_parent_ops);
if(!ret) {
ERR("Failed to create a destination surface for conversion\n");
return NULL;
#define GLINFO_LOCATION This->wineD3DDevice->adapter->gl_info
/*IWineD3DSwapChain parts follow: */
-static void WINAPI IWineD3DSwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB_DESTROYSURFACEFN D3DCB_DestroyRenderTarget) {
+static void WINAPI IWineD3DSwapChainImpl_Destroy(IWineD3DSwapChain *iface)
+{
IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *)iface;
WINED3DDISPLAYMODE mode;
unsigned int i;
if (This->frontBuffer)
{
IWineD3DSurface_SetContainer(This->frontBuffer, 0);
- if (D3DCB_DestroyRenderTarget(This->frontBuffer))
+ if (IWineD3DSurface_Release(This->frontBuffer))
{
- FIXME("(%p) Something's still holding the front buffer (%p).\n",
+ WARN("(%p) Something's still holding the front buffer (%p).\n",
This, This->frontBuffer);
}
This->frontBuffer = NULL;
while (i--)
{
IWineD3DSurface_SetContainer(This->backBuffer[i], 0);
- if (D3DCB_DestroyRenderTarget(This->backBuffer[i]))
- FIXME("(%p) Something's still holding back buffer %u (%p).\n",
+ if (IWineD3DSurface_Release(This->backBuffer[i]))
+ WARN("(%p) Something's still holding back buffer %u (%p).\n",
This, i, This->backBuffer[i]);
}
HeapFree(GetProcessHeap(), 0, This->backBuffer);
refCount = InterlockedDecrement(&This->ref);
TRACE("(%p) : ReleaseRef to %d\n", This, refCount);
if (refCount == 0) {
- IWineD3DSwapChain_Destroy(iface, D3DCB_DefaultDestroySurface);
+ IWineD3DSwapChain_Destroy(iface);
}
return refCount;
}
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
WINE_DECLARE_DEBUG_CHANNEL(fps);
-static void WINAPI IWineGDISwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB_DESTROYSURFACEFN D3DCB_DestroyRenderback) {
+static void WINAPI IWineGDISwapChainImpl_Destroy(IWineD3DSwapChain *iface)
+{
IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *)iface;
WINED3DDISPLAYMODE mode;
/* release the ref to the front and back buffer parents */
if(This->frontBuffer) {
IWineD3DSurface_SetContainer(This->frontBuffer, 0);
- if(D3DCB_DestroyRenderback(This->frontBuffer) > 0) {
- FIXME("(%p) Something's still holding the front buffer\n",This);
+ if (IWineD3DSurface_Release(This->frontBuffer) > 0)
+ {
+ WARN("(%p) Something's still holding the front buffer\n",This);
}
}
UINT i;
for(i = 0; i < This->presentParms.BackBufferCount; i++) {
IWineD3DSurface_SetContainer(This->backBuffer[i], 0);
- if(D3DCB_DestroyRenderback(This->backBuffer[i]) > 0) {
- FIXME("(%p) Something's still holding the back buffer\n",This);
+ if (IWineD3DSurface_Release(This->backBuffer[i]) > 0)
+ {
+ WARN("(%p) Something's still holding the back buffer\n",This);
}
}
HeapFree(GetProcessHeap(), 0, This->backBuffer);
*dirty = FALSE;
}
-static void texture_cleanup(IWineD3DTextureImpl *This, D3DCB_DESTROYSURFACEFN surface_destroy_cb)
+static void texture_cleanup(IWineD3DTextureImpl *This)
{
unsigned int i;
surface_set_texture_name(This->surfaces[i], 0, FALSE);
surface_set_texture_target(This->surfaces[i], 0);
IWineD3DSurface_SetContainer(This->surfaces[i], 0);
- surface_destroy_cb(This->surfaces[i]);
+ IWineD3DSurface_Release(This->surfaces[i]);
}
}
{
FIXME("Failed to create surface %p, hr %#x\n", texture, hr);
texture->surfaces[i] = NULL;
- texture_cleanup(texture, D3DCB_DefaultDestroySurface);
+ texture_cleanup(texture);
return hr;
}
TRACE("(%p) : Releasing from %d\n", This, This->resource.ref);
ref = InterlockedDecrement(&This->resource.ref);
if (ref == 0) {
- IWineD3DTexture_Destroy(iface, D3DCB_DefaultDestroySurface);
+ IWineD3DTexture_Destroy(iface);
}
return ref;
}
/* *******************************************
IWineD3DTexture IWineD3DTexture parts follow
******************************************* */
-static void WINAPI IWineD3DTextureImpl_Destroy(IWineD3DTexture *iface, D3DCB_DESTROYSURFACEFN D3DCB_DestroySurface) {
+static void WINAPI IWineD3DTextureImpl_Destroy(IWineD3DTexture *iface)
+{
IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface;
- texture_cleanup(This, D3DCB_DestroySurface);
+ texture_cleanup(This);
/* free the object */
HeapFree(GetProcessHeap(), 0, This);
}
#define WINE_D3D9_CAPABLE(gl_info) WINE_D3D8_CAPABLE(gl_info) && (gl_info->supported[ARB_FRAGMENT_PROGRAM] && gl_info->supported[ARB_VERTEX_SHADER])
/* Default callbacks for implicit object destruction */
-extern ULONG WINAPI D3DCB_DefaultDestroySurface(IWineD3DSurface *pSurface) DECLSPEC_HIDDEN;
-
extern ULONG WINAPI D3DCB_DefaultDestroyVolume(IWineD3DVolume *pSurface) DECLSPEC_HIDDEN;
/*****************************************************************************
};
extern const struct wine_rb_functions wined3d_ffp_frag_program_rb_functions DECLSPEC_HIDDEN;
+extern const struct wined3d_parent_ops wined3d_null_parent_ops DECLSPEC_HIDDEN;
void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_settings *settings,
BOOL ignore_textype) DECLSPEC_HIDDEN;
IWineD3DResourceClass resource;
/* IWineD3DSurface fields */
+ const struct wined3d_parent_ops *parent_ops;
IWineD3DBase *container;
WINED3DSURFACET_DESC currentDesc;
IWineD3DPaletteImpl *palette; /* D3D7 style palette handling */
HRESULT surface_init(IWineD3DSurfaceImpl *surface, WINED3DSURFTYPE surface_type, UINT alignment,
UINT width, UINT height, UINT level, BOOL lockable, BOOL discard, WINED3DMULTISAMPLE_TYPE multisample_type,
UINT multisample_quality, IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format,
- WINED3DPOOL pool, IUnknown *parent) DECLSPEC_HIDDEN;
+ WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
/* Predeclare the shared Surface functions */
HRESULT WINAPI IWineD3DBaseSurfaceImpl_QueryInterface(IWineD3DSurface *iface,
char *string_data;
};
+struct wined3d_parent_ops
+{
+ void (*wined3d_object_destroyed)(void *parent);
+};
+
interface IWineD3DResource;
interface IWineD3DSurface;
interface IWineD3DVolume;
[out] IWineD3DSwapChain **swapchain
);
}
-typedef ULONG (*D3DCB_DESTROYSURFACEFN)(IWineD3DSurface *pSurface);
typedef ULONG (*D3DCB_DESTROYVOLUMEFN)(IWineD3DVolume *pVolume);
typedef ULONG (*D3DCB_DESTROYSWAPCHAINFN)(IWineD3DSwapChain *pSwapChain);
typedef HRESULT (*D3DCB_ENUMRESOURCES)(IWineD3DResource *resource, void *pData);
interface IWineD3DTexture : IWineD3DBaseTexture
{
void Destroy(
- [in] D3DCB_DESTROYSURFACEFN destroy_surface_callback
);
HRESULT GetLevelDesc(
[in] UINT level,
interface IWineD3DCubeTexture : IWineD3DBaseTexture
{
void Destroy(
- [in] D3DCB_DESTROYSURFACEFN destroy_surface_callback
);
HRESULT GetLevelDesc(
[in] UINT level,
interface IWineD3DSwapChain : IWineD3DBase
{
void Destroy(
- [in] D3DCB_DESTROYSURFACEFN destroy_surface_callback
);
HRESULT GetDevice(
[out] IWineD3DDevice **device
[in] WINED3DMULTISAMPLE_TYPE multisample_type,
[in] DWORD multisample_quality,
[in] WINED3DSURFTYPE surface_type,
- [in] IUnknown *parent
+ [in] IUnknown *parent,
+ [in] const struct wined3d_parent_ops *parent_ops
);
HRESULT CreateRendertargetView(
[in] IWineD3DResource *resource,
[in] WINED3DPRESENT_PARAMETERS *present_parameters
);
HRESULT Uninit3D(
- [in] D3DCB_DESTROYSURFACEFN destroy_surface_callback,
[in] D3DCB_DESTROYSWAPCHAINFN destroy_swapchain_callback
);
HRESULT UninitGDI(