Commit 33025b20 authored by Jason Edmeades's avatar Jason Edmeades Committed by Alexandre Julliard

- Handle failures to allocate storage more gracefully.

- Only prototype the interfaces which are subclassed (I overdid it last time!). - Implement Get/Set Texture and GetBackBuffer, plus device's GetDisplayMode / GetDeviceCaps. - Make some of the d3d9 skeleton code issue fixme's to highlight code which hasn't been migrated yet. - Correct the d3d9 headers for D3DSURFACE_DESC which caused stack corruption in demos.
parent 64d7cb16
...@@ -158,7 +158,7 @@ HRESULT WINAPI IDirect3DCubeTexture9Impl_GetCubeMapSurface(LPDIRECT3DCUBETEXTURE ...@@ -158,7 +158,7 @@ HRESULT WINAPI IDirect3DCubeTexture9Impl_GetCubeMapSurface(LPDIRECT3DCUBETEXTURE
IWineD3DSurface *mySurface = NULL; IWineD3DSurface *mySurface = NULL;
hrc = IWineD3DCubeTexture_GetCubeMapSurface(This->wineD3DCubeTexture, FaceType, Level, &mySurface); hrc = IWineD3DCubeTexture_GetCubeMapSurface(This->wineD3DCubeTexture, FaceType, Level, &mySurface);
if (hrc == D3D_OK) { if (hrc == D3D_OK && NULL != ppCubeMapSurface) {
IWineD3DCubeTexture_GetParent(mySurface, (IUnknown **)ppCubeMapSurface); IWineD3DCubeTexture_GetParent(mySurface, (IUnknown **)ppCubeMapSurface);
IWineD3DCubeTexture_Release(mySurface); IWineD3DCubeTexture_Release(mySurface);
} }
...@@ -216,15 +216,29 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateCubeTexture(LPDIRECT3DDEVICE9 iface, ...@@ -216,15 +216,29 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateCubeTexture(LPDIRECT3DDEVICE9 iface,
IDirect3DCubeTexture9Impl *object; IDirect3DCubeTexture9Impl *object;
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
HRESULT hr = D3D_OK;
/* Allocate the storage for the device */ /* Allocate the storage for the device */
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DCubeTexture9Impl)); object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DCubeTexture9Impl));
if (NULL == object) {
FIXME("(%p) allocation of CubeTexture failed\n", This);
*ppCubeTexture = NULL;
return D3DERR_OUTOFVIDEOMEMORY;
}
object->lpVtbl = &Direct3DCubeTexture9_Vtbl; object->lpVtbl = &Direct3DCubeTexture9_Vtbl;
object->ref = 1; object->ref = 1;
IWineD3DDevice_CreateCubeTexture(This->WineD3DDevice, EdgeLength, Levels, Usage, hr = IWineD3DDevice_CreateCubeTexture(This->WineD3DDevice, EdgeLength, Levels, Usage,
Format, Pool, &(object->wineD3DCubeTexture), pSharedHandle, (IUnknown *)object, Format, Pool, &(object->wineD3DCubeTexture), pSharedHandle, (IUnknown *)object,
D3D9CB_CreateSurface); D3D9CB_CreateSurface);
if (hr != D3D_OK) {
/* free up object */
FIXME("(%p) call to IWineD3DDevice_CreateCubeTexture failed\n", This);
HeapFree(GetProcessHeap(), 0, object);
*ppCubeTexture = NULL;
} else {
*ppCubeTexture = (LPDIRECT3DCUBETEXTURE9) object; *ppCubeTexture = (LPDIRECT3DCUBETEXTURE9) object;
return D3D_OK; }
return hr;
} }
...@@ -71,7 +71,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_TestCooperativeLevel(LPDIRECT3DDEVICE9 ifa ...@@ -71,7 +71,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_TestCooperativeLevel(LPDIRECT3DDEVICE9 ifa
UINT WINAPI IDirect3DDevice9Impl_GetAvailableTextureMem(LPDIRECT3DDEVICE9 iface) { UINT WINAPI IDirect3DDevice9Impl_GetAvailableTextureMem(LPDIRECT3DDEVICE9 iface) {
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
TRACE("(%p) : stub, emulating 32Mb for now\n", This); FIXME("(%p) : stub, emulating 32Mb for now\n", This);
/* /*
* pretend we have 32MB of any type of memory queried. * pretend we have 32MB of any type of memory queried.
*/ */
...@@ -95,27 +95,24 @@ HRESULT WINAPI IDirect3DDevice9Impl_GetDirect3D(LPDIRECT3DDEVICE9 iface, IDire ...@@ -95,27 +95,24 @@ HRESULT WINAPI IDirect3DDevice9Impl_GetDirect3D(LPDIRECT3DDEVICE9 iface, IDire
HRESULT WINAPI IDirect3DDevice9Impl_GetDeviceCaps(LPDIRECT3DDEVICE9 iface, D3DCAPS9* pCaps) { HRESULT WINAPI IDirect3DDevice9Impl_GetDeviceCaps(LPDIRECT3DDEVICE9 iface, D3DCAPS9* pCaps) {
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
FIXME("(%p) : stub, calling idirect3d for now\n", This); return IWineD3DDevice_GetDeviceCaps(This->WineD3DDevice, pCaps);
IDirect3D9Impl_GetDeviceCaps((LPDIRECT3D9) This->direct3d, This->adapterNo, This->devType, pCaps);
return D3D_OK;
} }
HRESULT WINAPI IDirect3DDevice9Impl_GetDisplayMode(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DDISPLAYMODE* pMode) { HRESULT WINAPI IDirect3DDevice9Impl_GetDisplayMode(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DDISPLAYMODE* pMode) {
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
FIXME("(%p) : stub\n", This); return IWineD3DDevice_GetDisplayMode(This->WineD3DDevice, iSwapChain, pMode);
return D3D_OK;
} }
HRESULT WINAPI IDirect3DDevice9Impl_GetCreationParameters(LPDIRECT3DDEVICE9 iface, D3DDEVICE_CREATION_PARAMETERS *pParameters) { HRESULT WINAPI IDirect3DDevice9Impl_GetCreationParameters(LPDIRECT3DDEVICE9 iface, D3DDEVICE_CREATION_PARAMETERS *pParameters) {
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
TRACE("(%p) copying to %p\n", This, pParameters); FIXME("(%p) copying to %p\n", This, pParameters);
memcpy(pParameters, &This->CreateParms, sizeof(D3DDEVICE_CREATION_PARAMETERS)); memcpy(pParameters, &This->CreateParms, sizeof(D3DDEVICE_CREATION_PARAMETERS));
return D3D_OK; return D3D_OK;
} }
HRESULT WINAPI IDirect3DDevice9Impl_SetCursorProperties(LPDIRECT3DDEVICE9 iface, UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap) { HRESULT WINAPI IDirect3DDevice9Impl_SetCursorProperties(LPDIRECT3DDEVICE9 iface, UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap) {
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
TRACE("(%p) : Spot Pos(%u,%u)\n", This, XHotSpot, YHotSpot); FIXME("(%p) : Spot Pos(%u,%u)\n", This, XHotSpot, YHotSpot);
/* TODO: /* TODO:
IDirect3DSurface9Impl* pSur = (IDirect3DSurface9Impl*) pCursorBitmap; IDirect3DSurface9Impl* pSur = (IDirect3DSurface9Impl*) pCursorBitmap;
...@@ -136,7 +133,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_SetCursorProperties(LPDIRECT3DDEVICE9 ifac ...@@ -136,7 +133,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_SetCursorProperties(LPDIRECT3DDEVICE9 ifac
void WINAPI IDirect3DDevice9Impl_SetCursorPosition(LPDIRECT3DDEVICE9 iface, int XScreenSpace, int YScreenSpace, DWORD Flags) { void WINAPI IDirect3DDevice9Impl_SetCursorPosition(LPDIRECT3DDEVICE9 iface, int XScreenSpace, int YScreenSpace, DWORD Flags) {
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
TRACE("(%p) : SetPos to (%u,%u)\n", This, XScreenSpace, YScreenSpace); FIXME("(%p) : SetPos to (%u,%u)\n", This, XScreenSpace, YScreenSpace);
This->xScreenSpace = XScreenSpace; This->xScreenSpace = XScreenSpace;
This->yScreenSpace = YScreenSpace; This->yScreenSpace = YScreenSpace;
return; return;
...@@ -144,7 +141,7 @@ void WINAPI IDirect3DDevice9Impl_SetCursorPosition(LPDIRECT3DDEVICE9 iface, ...@@ -144,7 +141,7 @@ void WINAPI IDirect3DDevice9Impl_SetCursorPosition(LPDIRECT3DDEVICE9 iface,
BOOL WINAPI IDirect3DDevice9Impl_ShowCursor(LPDIRECT3DDEVICE9 iface, BOOL bShow) { BOOL WINAPI IDirect3DDevice9Impl_ShowCursor(LPDIRECT3DDEVICE9 iface, BOOL bShow) {
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
TRACE("(%p) : visible(%d)\n", This, bShow); FIXME("(%p) : visible(%d)\n", This, bShow);
This->bCursorVisible = bShow; This->bCursorVisible = bShow;
return D3D_OK; return D3D_OK;
} }
...@@ -162,15 +159,16 @@ HRESULT WINAPI IDirect3DDevice9Impl_Present(LPDIRECT3DDEVICE9 iface, CONST REC ...@@ -162,15 +159,16 @@ HRESULT WINAPI IDirect3DDevice9Impl_Present(LPDIRECT3DDEVICE9 iface, CONST REC
HRESULT WINAPI IDirect3DDevice9Impl_GetBackBuffer(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, UINT BackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer) { HRESULT WINAPI IDirect3DDevice9Impl_GetBackBuffer(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, UINT BackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer) {
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
*ppBackBuffer = (LPDIRECT3DSURFACE9) This->backBuffer;
TRACE("(%p) : BackBuf %d Type %d returning %p\n", This, BackBuffer, Type, *ppBackBuffer); IWineD3DSurface *retSurface = NULL;
if (BackBuffer > This->PresentParms.BackBufferCount - 1) { HRESULT rc = D3D_OK;
FIXME("Only one backBuffer currently supported\n");
return D3DERR_INVALIDCALL; rc = IWineD3DDevice_GetBackBuffer(This->WineD3DDevice, iSwapChain, BackBuffer, Type, (IWineD3DSurface **)&retSurface);
if (rc == D3D_OK && NULL != ppBackBuffer) {
IWineD3DSurface_GetParent(retSurface, (IUnknown **)ppBackBuffer);
IWineD3DSurface_Release(retSurface);
} }
/* Note inc ref on returned surface */ return rc;
IDirect3DSurface9Impl_AddRef((LPDIRECT3DSURFACE9) *ppBackBuffer);
return D3D_OK;
} }
HRESULT WINAPI IDirect3DDevice9Impl_GetRasterStatus(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus) { HRESULT WINAPI IDirect3DDevice9Impl_GetRasterStatus(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus) {
...@@ -213,16 +211,29 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateRenderTarget(LPDIRECT3DDEVICE9 iface ...@@ -213,16 +211,29 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateRenderTarget(LPDIRECT3DDEVICE9 iface
IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) { IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) {
IDirect3DSurface9Impl *object; IDirect3DSurface9Impl *object;
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
HRESULT hrc = D3D_OK;
/* Allocate the storage for the device */ /* Allocate the storage for the device */
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DSurface9Impl)); object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DSurface9Impl));
if (NULL == object) {
FIXME("Allocation of memory failed\n");
*ppSurface = NULL;
return D3DERR_OUTOFVIDEOMEMORY;
}
object->lpVtbl = &Direct3DSurface9_Vtbl; object->lpVtbl = &Direct3DSurface9_Vtbl;
object->ref = 1; object->ref = 1;
IWineD3DDevice_CreateRenderTarget(This->WineD3DDevice, Width, Height, Format, MultiSample, MultisampleQuality, hrc = IWineD3DDevice_CreateRenderTarget(This->WineD3DDevice, Width, Height, Format, MultiSample, MultisampleQuality,
Lockable, &object->wineD3DSurface, pSharedHandle, (IUnknown *)object); Lockable, &object->wineD3DSurface, pSharedHandle, (IUnknown *)object);
if (hrc != D3D_OK) {
/* free up object */
FIXME("(%p) call to IWineD3DDevice_CreateRenderTarget failed\n", This);
HeapFree(GetProcessHeap(), 0, object);
*ppSurface = NULL;
} else {
*ppSurface = (LPDIRECT3DSURFACE9) object; *ppSurface = (LPDIRECT3DSURFACE9) object;
}
return D3D_OK; return hrc;
} }
HRESULT WINAPI IDirect3DDevice9Impl_CreateDepthStencilSurface(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) { HRESULT WINAPI IDirect3DDevice9Impl_CreateDepthStencilSurface(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) {
...@@ -276,16 +287,29 @@ HRESULT WINAPI IDirect3DDevice9Impl_ColorFill(LPDIRECT3DDEVICE9 iface, IDirect ...@@ -276,16 +287,29 @@ HRESULT WINAPI IDirect3DDevice9Impl_ColorFill(LPDIRECT3DDEVICE9 iface, IDirect
HRESULT WINAPI IDirect3DDevice9Impl_CreateOffscreenPlainSurface(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) { HRESULT WINAPI IDirect3DDevice9Impl_CreateOffscreenPlainSurface(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) {
IDirect3DSurface9Impl *object; IDirect3DSurface9Impl *object;
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
HRESULT hrc = D3D_OK;
/* Allocate the storage for the device */ /* Allocate the storage for the device */
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DSurface9Impl)); object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DSurface9Impl));
if (NULL == object) {
FIXME("Allocation of memory failed\n");
*ppSurface = NULL;
return D3DERR_OUTOFVIDEOMEMORY;
}
object->lpVtbl = &Direct3DSurface9_Vtbl; object->lpVtbl = &Direct3DSurface9_Vtbl;
object->ref = 1; object->ref = 1;
IWineD3DDevice_CreateOffscreenPlainSurface(This->WineD3DDevice, Width, Height, Format, Pool, hrc = IWineD3DDevice_CreateOffscreenPlainSurface(This->WineD3DDevice, Width, Height, Format, Pool,
&(object->wineD3DSurface), pSharedHandle, (IUnknown *)object); &(object->wineD3DSurface), pSharedHandle, (IUnknown *)object);
if (hrc != D3D_OK) {
/* free up object */
FIXME("(%p) call to IWineD3DDevice_CreateOffscreenPlainSurface failed\n", This);
HeapFree(GetProcessHeap(), 0, object);
*ppSurface = NULL;
} else {
*ppSurface = (LPDIRECT3DSURFACE9) object; *ppSurface = (LPDIRECT3DSURFACE9) object;
return D3D_OK; }
return hrc;
} }
HRESULT WINAPI IDirect3DDevice9Impl_SetRenderTarget(LPDIRECT3DDEVICE9 iface, DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget) { HRESULT WINAPI IDirect3DDevice9Impl_SetRenderTarget(LPDIRECT3DDEVICE9 iface, DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget) {
...@@ -414,16 +438,21 @@ HRESULT WINAPI IDirect3DDevice9Impl_GetClipStatus(LPDIRECT3DDEVICE9 iface, D3D ...@@ -414,16 +438,21 @@ HRESULT WINAPI IDirect3DDevice9Impl_GetClipStatus(LPDIRECT3DDEVICE9 iface, D3D
HRESULT WINAPI IDirect3DDevice9Impl_GetTexture(LPDIRECT3DDEVICE9 iface, DWORD Stage, IDirect3DBaseTexture9** ppTexture) { HRESULT WINAPI IDirect3DDevice9Impl_GetTexture(LPDIRECT3DDEVICE9 iface, DWORD Stage, IDirect3DBaseTexture9** ppTexture) {
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
TRACE("(%p) : returning %p for stage %ld\n", This, This->UpdateStateBlock->textures[Stage], Stage); IWineD3DBaseTexture *retTexture = NULL;
*ppTexture = (LPDIRECT3DBASETEXTURE9) This->UpdateStateBlock->textures[Stage]; HRESULT rc = D3D_OK;
IDirect3DBaseTexture9Impl_AddRef(*ppTexture);
return D3D_OK; rc = IWineD3DDevice_GetTexture(This->WineD3DDevice, Stage, (IWineD3DBaseTexture **)&retTexture);
if (rc == D3D_OK && NULL != ppTexture) {
IWineD3DBaseTexture_GetParent(retTexture, (IUnknown **)ppTexture);
IWineD3DBaseTexture_Release(retTexture);
}
return rc;
} }
HRESULT WINAPI IDirect3DDevice9Impl_SetTexture(LPDIRECT3DDEVICE9 iface, DWORD Stage, IDirect3DBaseTexture9* pTexture) { HRESULT WINAPI IDirect3DDevice9Impl_SetTexture(LPDIRECT3DDEVICE9 iface, DWORD Stage, IDirect3DBaseTexture9* pTexture) {
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
FIXME("(%p) : stub\n", This); return IWineD3DDevice_SetTexture(This->WineD3DDevice, Stage,
return D3D_OK; pTexture==NULL ? NULL:((IDirect3DBaseTexture9Impl *)pTexture)->wineD3DBaseTexture);
} }
HRESULT WINAPI IDirect3DDevice9Impl_GetTextureStageState(LPDIRECT3DDEVICE9 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue) { HRESULT WINAPI IDirect3DDevice9Impl_GetTextureStageState(LPDIRECT3DDEVICE9 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue) {
...@@ -570,7 +599,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_GetStreamSource(LPDIRECT3DDEVICE9 iface, U ...@@ -570,7 +599,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_GetStreamSource(LPDIRECT3DDEVICE9 iface, U
HRESULT rc = D3D_OK; HRESULT rc = D3D_OK;
rc = IWineD3DDevice_GetStreamSource(This->WineD3DDevice, StreamNumber, (IWineD3DVertexBuffer **)&retStream, OffsetInBytes, pStride); rc = IWineD3DDevice_GetStreamSource(This->WineD3DDevice, StreamNumber, (IWineD3DVertexBuffer **)&retStream, OffsetInBytes, pStride);
if (rc == D3D_OK && NULL != *pStream) { if (rc == D3D_OK && NULL != pStream) {
IWineD3DVertexBuffer_GetParent(retStream, (IUnknown **)pStream); IWineD3DVertexBuffer_GetParent(retStream, (IUnknown **)pStream);
IWineD3DVertexBuffer_Release(retStream); IWineD3DVertexBuffer_Release(retStream);
} }
...@@ -603,7 +632,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_GetIndices(LPDIRECT3DDEVICE9 iface, IDirec ...@@ -603,7 +632,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_GetIndices(LPDIRECT3DDEVICE9 iface, IDirec
UINT tmp; UINT tmp;
rc = IWineD3DDevice_GetIndices(This->WineD3DDevice, &retIndexData, &tmp); rc = IWineD3DDevice_GetIndices(This->WineD3DDevice, &retIndexData, &tmp);
if (rc == D3D_OK && NULL != *ppIndexData) { if (rc == D3D_OK && NULL != ppIndexData) {
IWineD3DVertexBuffer_GetParent(retIndexData, (IUnknown **)ppIndexData); IWineD3DVertexBuffer_GetParent(retIndexData, (IUnknown **)ppIndexData);
IWineD3DVertexBuffer_Release(retIndexData); IWineD3DVertexBuffer_Release(retIndexData);
} }
......
...@@ -144,7 +144,7 @@ HRESULT WINAPI IDirect3D9Impl_CheckDeviceFormatConversion(LPDIRECT3D9 iface, U ...@@ -144,7 +144,7 @@ HRESULT WINAPI IDirect3D9Impl_CheckDeviceFormatConversion(LPDIRECT3D9 iface, U
HRESULT WINAPI IDirect3D9Impl_GetDeviceCaps(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps) { HRESULT WINAPI IDirect3D9Impl_GetDeviceCaps(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps) {
IDirect3D9Impl *This = (IDirect3D9Impl *)iface; IDirect3D9Impl *This = (IDirect3D9Impl *)iface;
return IWineD3D_GetDeviceCaps(This->WineD3D, Adapter, DeviceType, (void *)pCaps); return IWineD3D_GetDeviceCaps(This->WineD3D, Adapter, DeviceType, (WINED3DCAPS *)pCaps);
} }
HMONITOR WINAPI IDirect3D9Impl_GetAdapterMonitor(LPDIRECT3D9 iface, UINT Adapter) { HMONITOR WINAPI IDirect3D9Impl_GetAdapterMonitor(LPDIRECT3D9 iface, UINT Adapter) {
...@@ -165,6 +165,8 @@ HRESULT WINAPI D3D9CB_CreateRenderTarget(IUnknown *device, UINT Width, UINT Heig ...@@ -165,6 +165,8 @@ HRESULT WINAPI D3D9CB_CreateRenderTarget(IUnknown *device, UINT Width, UINT Heig
(IDirect3DSurface9 **)&d3dSurface, pSharedHandle); (IDirect3DSurface9 **)&d3dSurface, pSharedHandle);
if (res == D3D_OK) { if (res == D3D_OK) {
*ppSurface = d3dSurface->wineD3DSurface; *ppSurface = d3dSurface->wineD3DSurface;
} else {
*ppSurface = NULL;
} }
return res; return res;
} }
...@@ -179,14 +181,18 @@ HRESULT WINAPI IDirect3D9Impl_CreateDevice(LPDIRECT3D9 iface, UINT Adapter, D3 ...@@ -179,14 +181,18 @@ HRESULT WINAPI IDirect3D9Impl_CreateDevice(LPDIRECT3D9 iface, UINT Adapter, D3
/* Check the validity range of the adapter parameter */ /* Check the validity range of the adapter parameter */
if (Adapter >= IDirect3D9Impl_GetAdapterCount(iface)) { if (Adapter >= IDirect3D9Impl_GetAdapterCount(iface)) {
*ppReturnedDeviceInterface = NULL;
return D3DERR_INVALIDCALL; return D3DERR_INVALIDCALL;
} }
/* Allocate the storage for the device object */ /* Allocate the storage for the device object */
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DDevice9Impl)); object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DDevice9Impl));
if (NULL == object) { if (NULL == object) {
FIXME("Allocation of memory failed\n");
*ppReturnedDeviceInterface = NULL;
return D3DERR_OUTOFVIDEOMEMORY; return D3DERR_OUTOFVIDEOMEMORY;
} }
object->lpVtbl = &Direct3DDevice9_Vtbl; object->lpVtbl = &Direct3DDevice9_Vtbl;
object->ref = 1; object->ref = 1;
object->direct3d = This; object->direct3d = This;
...@@ -208,10 +214,7 @@ HRESULT WINAPI IDirect3D9Impl_CreateDevice(LPDIRECT3D9 iface, UINT Adapter, D3 ...@@ -208,10 +214,7 @@ HRESULT WINAPI IDirect3D9Impl_CreateDevice(LPDIRECT3D9 iface, UINT Adapter, D3
localParameters.Flags = &pPresentationParameters->Flags; localParameters.Flags = &pPresentationParameters->Flags;
localParameters.FullScreen_RefreshRateInHz = &pPresentationParameters->FullScreen_RefreshRateInHz; localParameters.FullScreen_RefreshRateInHz = &pPresentationParameters->FullScreen_RefreshRateInHz;
localParameters.PresentationInterval = &pPresentationParameters->PresentationInterval; localParameters.PresentationInterval = &pPresentationParameters->PresentationInterval;
IWineD3D_CreateDevice(This->WineD3D, Adapter, DeviceType, hFocusWindow, BehaviourFlags, &localParameters, &object->WineD3DDevice, (IUnknown *)object, D3D9CB_CreateRenderTarget); return IWineD3D_CreateDevice(This->WineD3D, Adapter, DeviceType, hFocusWindow, BehaviourFlags, &localParameters, &object->WineD3DDevice, (IUnknown *)object, D3D9CB_CreateRenderTarget);
FIXME("(%p) : incomplete stub\n", This);
return D3D_OK;
} }
IDirect3D9Vtbl Direct3D9_Vtbl = IDirect3D9Vtbl Direct3D9_Vtbl =
......
...@@ -142,13 +142,26 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateIndexBuffer(LPDIRECT3DDEVICE9 iface, ...@@ -142,13 +142,26 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateIndexBuffer(LPDIRECT3DDEVICE9 iface,
IDirect3DIndexBuffer9Impl *object; IDirect3DIndexBuffer9Impl *object;
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
HRESULT hrc = D3D_OK;
/* Allocate the storage for the device */ /* Allocate the storage for the device */
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DIndexBuffer9Impl)); object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DIndexBuffer9Impl));
if (NULL == object) {
FIXME("Allocation of memory failed\n");
*ppIndexBuffer = NULL;
return D3DERR_OUTOFVIDEOMEMORY;
}
object->lpVtbl = &Direct3DIndexBuffer9_Vtbl; object->lpVtbl = &Direct3DIndexBuffer9_Vtbl;
object->ref = 1; object->ref = 1;
IWineD3DDevice_CreateIndexBuffer(This->WineD3DDevice, Length, Usage, Format, Pool, &(object->wineD3DIndexBuffer), pSharedHandle, (IUnknown *)object); hrc = IWineD3DDevice_CreateIndexBuffer(This->WineD3DDevice, Length, Usage, Format, Pool, &(object->wineD3DIndexBuffer), pSharedHandle, (IUnknown *)object);
if (hrc != D3D_OK) {
/* free up object */
FIXME("(%p) call to IWineD3DDevice_CreateIndexBuffer failed\n", This);
HeapFree(GetProcessHeap(), 0, object);
*ppIndexBuffer = NULL;
} else {
*ppIndexBuffer = (LPDIRECT3DINDEXBUFFER9) object; *ppIndexBuffer = (LPDIRECT3DINDEXBUFFER9) object;
return D3D_OK; }
return hrc;
} }
...@@ -204,6 +204,8 @@ HRESULT WINAPI D3D9CB_CreateSurface(IUnknown *pDevice, ...@@ -204,6 +204,8 @@ HRESULT WINAPI D3D9CB_CreateSurface(IUnknown *pDevice,
Format, Pool, (IDirect3DSurface9 **)&d3dSurface, pSharedHandle); Format, Pool, (IDirect3DSurface9 **)&d3dSurface, pSharedHandle);
if (res == D3D_OK) { if (res == D3D_OK) {
*ppSurface = d3dSurface->wineD3DSurface; *ppSurface = d3dSurface->wineD3DSurface;
} else {
*ppSurface = NULL;
} }
return res; return res;
} }
...@@ -158,7 +158,7 @@ HRESULT WINAPI IDirect3DTexture9Impl_GetSurfaceLevel(LPDIRECT3DTEXTURE9 iface, U ...@@ -158,7 +158,7 @@ HRESULT WINAPI IDirect3DTexture9Impl_GetSurfaceLevel(LPDIRECT3DTEXTURE9 iface, U
IWineD3DSurface *mySurface = NULL; IWineD3DSurface *mySurface = NULL;
hrc = IWineD3DTexture_GetSurfaceLevel(This->wineD3DTexture, Level, &mySurface); hrc = IWineD3DTexture_GetSurfaceLevel(This->wineD3DTexture, Level, &mySurface);
if (hrc == D3D_OK) { if (hrc == D3D_OK && NULL != ppSurfaceLevel) {
IWineD3DSurface_GetParent(mySurface, (IUnknown **)ppSurfaceLevel); IWineD3DSurface_GetParent(mySurface, (IUnknown **)ppSurfaceLevel);
IWineD3DSurface_Release(mySurface); IWineD3DSurface_Release(mySurface);
} }
...@@ -213,14 +213,28 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateTexture(LPDIRECT3DDEVICE9 iface, UIN ...@@ -213,14 +213,28 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateTexture(LPDIRECT3DDEVICE9 iface, UIN
D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle) { D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle) {
IDirect3DTexture9Impl *object; IDirect3DTexture9Impl *object;
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
HRESULT hrc = D3D_OK;
/* Allocate the storage for the device */ /* Allocate the storage for the device */
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DTexture9Impl)); object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DTexture9Impl));
if (NULL == object) {
FIXME("Allocation of memory failed\n");
*ppTexture = NULL;
return D3DERR_OUTOFVIDEOMEMORY;
}
object->lpVtbl = &Direct3DTexture9_Vtbl; object->lpVtbl = &Direct3DTexture9_Vtbl;
object->ref = 1; object->ref = 1;
IWineD3DDevice_CreateTexture(This->WineD3DDevice, Width, Height, Levels, Usage, hrc = IWineD3DDevice_CreateTexture(This->WineD3DDevice, Width, Height, Levels, Usage,
Format, Pool, &(object->wineD3DTexture), pSharedHandle, (IUnknown *)object, D3D9CB_CreateSurface); Format, Pool, &(object->wineD3DTexture), pSharedHandle, (IUnknown *)object, D3D9CB_CreateSurface);
if (hrc != D3D_OK) {
/* free up object */
FIXME("(%p) call to IWineD3DDevice_CreateTexture failed\n", This);
HeapFree(GetProcessHeap(), 0, object);
*ppTexture = NULL;
} else {
*ppTexture = (LPDIRECT3DTEXTURE9) object; *ppTexture = (LPDIRECT3DTEXTURE9) object;
return D3D_OK; }
return hrc;
} }
...@@ -141,13 +141,27 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexBuffer(LPDIRECT3DDEVICE9 iface, ...@@ -141,13 +141,27 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexBuffer(LPDIRECT3DDEVICE9 iface,
IDirect3DVertexBuffer9Impl *object; IDirect3DVertexBuffer9Impl *object;
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
HRESULT hrc = D3D_OK;
/* Allocate the storage for the device */ /* Allocate the storage for the device */
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DVertexBuffer9Impl)); object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DVertexBuffer9Impl));
if (NULL == object) {
FIXME("Allocation of memory failed\n");
*ppVertexBuffer = NULL;
return D3DERR_OUTOFVIDEOMEMORY;
}
object->lpVtbl = &Direct3DVertexBuffer9_Vtbl; object->lpVtbl = &Direct3DVertexBuffer9_Vtbl;
object->ref = 1; object->ref = 1;
IWineD3DDevice_CreateVertexBuffer(This->WineD3DDevice, Size, Usage, FVF, Pool, &(object->wineD3DVertexBuffer), pSharedHandle, (IUnknown *)object); hrc = IWineD3DDevice_CreateVertexBuffer(This->WineD3DDevice, Size, Usage, FVF, Pool, &(object->wineD3DVertexBuffer), pSharedHandle, (IUnknown *)object);
if (hrc != D3D_OK) {
/* free up object */
FIXME("(%p) call to IWineD3DDevice_CreateVertexBuffer failed\n", This);
HeapFree(GetProcessHeap(), 0, object);
*ppVertexBuffer = NULL;
} else {
*ppVertexBuffer = (LPDIRECT3DVERTEXBUFFER9) object; *ppVertexBuffer = (LPDIRECT3DVERTEXBUFFER9) object;
}
return D3D_OK; return hrc;
} }
...@@ -90,7 +90,7 @@ HRESULT WINAPI IDirect3DVolume9Impl_GetContainer(LPDIRECT3DVOLUME9 iface, REFIID ...@@ -90,7 +90,7 @@ HRESULT WINAPI IDirect3DVolume9Impl_GetContainer(LPDIRECT3DVOLUME9 iface, REFIID
res = IWineD3DVolume_GetContainer(This->wineD3DVolume, riid, (void **)&IWineContainer); res = IWineD3DVolume_GetContainer(This->wineD3DVolume, riid, (void **)&IWineContainer);
/* If this works, the only valid container is a child of resource (volumetexture) */ /* If this works, the only valid container is a child of resource (volumetexture) */
if (res == D3D_OK) { if (res == D3D_OK && NULL != ppContainer) {
IWineD3DResource_GetParent((IWineD3DResource *)IWineContainer, (IUnknown **)ppContainer); IWineD3DResource_GetParent((IWineD3DResource *)IWineContainer, (IUnknown **)ppContainer);
IWineD3DResource_Release((IWineD3DResource *)IWineContainer); IWineD3DResource_Release((IWineD3DResource *)IWineContainer);
} }
...@@ -148,11 +148,27 @@ HRESULT WINAPI D3D9CB_CreateVolume(IUnknown *pDevice, UINT Width, UINT Height, ...@@ -148,11 +148,27 @@ HRESULT WINAPI D3D9CB_CreateVolume(IUnknown *pDevice, UINT Width, UINT Height,
HANDLE * pSharedHandle) { HANDLE * pSharedHandle) {
IDirect3DVolume9Impl *object; IDirect3DVolume9Impl *object;
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)pDevice; IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)pDevice;
HRESULT hrc = D3D_OK;
/* Allocate the storage for the device */ /* Allocate the storage for the device */
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DVolume9Impl)); object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DVolume9Impl));
if (NULL == object) {
FIXME("Allocation of memory failed\n");
*ppVolume = NULL;
return D3DERR_OUTOFVIDEOMEMORY;
}
object->lpVtbl = &Direct3DVolume9_Vtbl; object->lpVtbl = &Direct3DVolume9_Vtbl;
object->ref = 1; object->ref = 1;
return IWineD3DDevice_CreateVolume(This->WineD3DDevice, Width, Height, Depth, Usage, Format, hrc = IWineD3DDevice_CreateVolume(This->WineD3DDevice, Width, Height, Depth, Usage, Format,
Pool, ppVolume, pSharedHandle, (IUnknown *)object); Pool, ppVolume, pSharedHandle, (IUnknown *)object);
if (hrc != D3D_OK) {
/* free up object */
FIXME("(%p) call to IWineD3DDevice_CreateVolume failed\n", This);
HeapFree(GetProcessHeap(), 0, object);
*ppVolume = NULL;
} else {
*ppVolume = (IWineD3DVolume *)object;
}
return hrc;
} }
...@@ -156,7 +156,7 @@ HRESULT WINAPI IDirect3DVolumeTexture9Impl_GetVolumeLevel(LPDIRECT3DVOLUMETEXTUR ...@@ -156,7 +156,7 @@ HRESULT WINAPI IDirect3DVolumeTexture9Impl_GetVolumeLevel(LPDIRECT3DVOLUMETEXTUR
IWineD3DVolume *myVolume = NULL; IWineD3DVolume *myVolume = NULL;
hrc = IWineD3DVolumeTexture_GetVolumeLevel(This->wineD3DVolumeTexture, Level, &myVolume); hrc = IWineD3DVolumeTexture_GetVolumeLevel(This->wineD3DVolumeTexture, Level, &myVolume);
if (hrc == D3D_OK) { if (hrc == D3D_OK && NULL != ppVolumeLevel) {
IWineD3DVolumeTexture_GetParent(myVolume, (IUnknown **)ppVolumeLevel); IWineD3DVolumeTexture_GetParent(myVolume, (IUnknown **)ppVolumeLevel);
IWineD3DVolumeTexture_Release(myVolume); IWineD3DVolumeTexture_Release(myVolume);
} }
...@@ -214,15 +214,30 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateVolumeTexture(LPDIRECT3DDEVICE9 ifac ...@@ -214,15 +214,30 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateVolumeTexture(LPDIRECT3DDEVICE9 ifac
IDirect3DVolumeTexture9Impl *object; IDirect3DVolumeTexture9Impl *object;
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
HRESULT hrc = D3D_OK;
/* Allocate the storage for the device */ /* Allocate the storage for the device */
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DVolumeTexture9Impl)); object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DVolumeTexture9Impl));
if (NULL == object) {
FIXME("(%p) allocation of memory failed\n", This);
*ppVolumeTexture = NULL;
return D3DERR_OUTOFVIDEOMEMORY;
}
object->lpVtbl = &Direct3DVolumeTexture9_Vtbl; object->lpVtbl = &Direct3DVolumeTexture9_Vtbl;
object->ref = 1; object->ref = 1;
IWineD3DDevice_CreateVolumeTexture(This->WineD3DDevice, Width, Height, Depth, Levels, Usage, hrc = IWineD3DDevice_CreateVolumeTexture(This->WineD3DDevice, Width, Height, Depth, Levels, Usage,
Format, Pool, &(object->wineD3DVolumeTexture), pSharedHandle, Format, Pool, &(object->wineD3DVolumeTexture), pSharedHandle,
(IUnknown *)object, D3D9CB_CreateVolume); (IUnknown *)object, D3D9CB_CreateVolume);
if (hrc != D3D_OK) {
/* free up object */
FIXME("(%p) call to IWineD3DDevice_CreateVolumeTexture failed\n", This);
HeapFree(GetProcessHeap(), 0, object);
*ppVolumeTexture = NULL;
} else {
*ppVolumeTexture = (LPDIRECT3DVOLUMETEXTURE9) object; *ppVolumeTexture = (LPDIRECT3DVOLUMETEXTURE9) object;
return D3D_OK; }
return hrc;
} }
...@@ -986,7 +986,7 @@ HRESULT WINAPI IWineD3DImpl_CheckDeviceFormatConversion(IWineD3D *iface, UINT ...@@ -986,7 +986,7 @@ HRESULT WINAPI IWineD3DImpl_CheckDeviceFormatConversion(IWineD3D *iface, UINT
/* Note: d3d8 passes in a pointer to a D3DCAPS8 structure, which is a true /* Note: d3d8 passes in a pointer to a D3DCAPS8 structure, which is a true
subset of a D3DCAPS9 structure. However, it has to come via a void * subset of a D3DCAPS9 structure. However, it has to come via a void *
as the d3d8 interface cannot import the d3d9 header */ as the d3d8 interface cannot import the d3d9 header */
HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter, D3DDEVTYPE DeviceType, void* pCapsIn) { HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter, D3DDEVTYPE DeviceType, WINED3DCAPS* pCapsIn) {
IWineD3DImpl *This = (IWineD3DImpl *)iface; IWineD3DImpl *This = (IWineD3DImpl *)iface;
BOOL gotContext = FALSE; BOOL gotContext = FALSE;
......
...@@ -124,7 +124,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_GetDesc(IWineD3DSurface *iface, WINED3DSURFAC ...@@ -124,7 +124,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_GetDesc(IWineD3DSurface *iface, WINED3DSURFAC
*(pDesc->Type) = This->currentDesc.Type; *(pDesc->Type) = This->currentDesc.Type;
*(pDesc->Usage) = This->currentDesc.Usage; *(pDesc->Usage) = This->currentDesc.Usage;
*(pDesc->Pool) = This->currentDesc.Pool; *(pDesc->Pool) = This->currentDesc.Pool;
*(pDesc->Size) = This->currentDesc.Size; /* dx8 only */ *(pDesc->Size) = This->currentDesc_size; /* dx8 only */
*(pDesc->MultiSampleType) = This->currentDesc.MultiSampleType; *(pDesc->MultiSampleType) = This->currentDesc.MultiSampleType;
*(pDesc->MultiSampleQuality) = This->currentDesc.MultiSampleQuality; *(pDesc->MultiSampleQuality) = This->currentDesc.MultiSampleQuality;
*(pDesc->Width) = This->currentDesc.Width; *(pDesc->Width) = This->currentDesc.Width;
...@@ -569,7 +569,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface, GLenum gl ...@@ -569,7 +569,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface, GLenum gl
This->currentDesc.Width, This->currentDesc.Width,
This->currentDesc.Height, This->currentDesc.Height,
0, 0,
This->currentDesc.Size, This->currentDesc_size,
This->allocatedMemory); This->allocatedMemory);
ENTER_GL(); ENTER_GL();
...@@ -580,7 +580,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface, GLenum gl ...@@ -580,7 +580,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface, GLenum gl
This->currentDesc.Width, This->currentDesc.Width,
This->currentDesc.Height, This->currentDesc.Height,
0, 0,
This->currentDesc.Size, This->currentDesc_size,
This->allocatedMemory); This->allocatedMemory);
checkGLcall("glCommpressedTexTexImage2D"); checkGLcall("glCommpressedTexTexImage2D");
......
...@@ -1304,7 +1304,6 @@ typedef struct _D3DSURFACE_DESC { ...@@ -1304,7 +1304,6 @@ typedef struct _D3DSURFACE_DESC {
D3DRESOURCETYPE Type; D3DRESOURCETYPE Type;
DWORD Usage; DWORD Usage;
D3DPOOL Pool; D3DPOOL Pool;
UINT Size;
D3DMULTISAMPLE_TYPE MultiSampleType; D3DMULTISAMPLE_TYPE MultiSampleType;
DWORD MultiSampleQuality; DWORD MultiSampleQuality;
UINT Width; UINT Width;
......
...@@ -96,17 +96,27 @@ typedef struct _WINED3DVOLUME_DESC ...@@ -96,17 +96,27 @@ typedef struct _WINED3DVOLUME_DESC
UINT *Depth; UINT *Depth;
} WINED3DVOLUME_DESC; } WINED3DVOLUME_DESC;
/* The following have differing names, but actually are the same layout */ /* The following have differing names, but actually are the same layout. */
/* Also, D3DCAPS8 is a subset of D3DCAPS9 so can be typecase as long as
none of the 9 fields are accessed when the device is d3d8 */
#if defined( __WINE_D3D8_H ) #if defined( __WINE_D3D8_H )
/* Identical: */
#define WINED3DLIGHT D3DLIGHT8 #define WINED3DLIGHT D3DLIGHT8
#define WINED3DCLIPSTATUS D3DCLIPSTATUS8 #define WINED3DCLIPSTATUS D3DCLIPSTATUS8
#define WINED3DMATERIAL D3DMATERIAL8 #define WINED3DMATERIAL D3DMATERIAL8
#define WINED3DVIEWPORT D3DVIEWPORT8 #define WINED3DVIEWPORT D3DVIEWPORT8
/* Subset: */
#define WINED3DCAPS D3DCAPS8
#else #else
/* Identical: */
#define WINED3DLIGHT D3DLIGHT9 #define WINED3DLIGHT D3DLIGHT9
#define WINED3DCLIPSTATUS D3DCLIPSTATUS9 #define WINED3DCLIPSTATUS D3DCLIPSTATUS9
#define WINED3DMATERIAL D3DMATERIAL9 #define WINED3DMATERIAL D3DMATERIAL9
#define WINED3DVIEWPORT D3DVIEWPORT9 #define WINED3DVIEWPORT D3DVIEWPORT9
/* Subsets: */
#define WINED3DCAPS D3DCAPS9
#endif #endif
typedef struct IWineD3D IWineD3D; typedef struct IWineD3D IWineD3D;
...@@ -178,7 +188,7 @@ DECLARE_INTERFACE_(IWineD3D,IUnknown) ...@@ -178,7 +188,7 @@ DECLARE_INTERFACE_(IWineD3D,IUnknown)
STDMETHOD(CheckDeviceType)(THIS_ UINT Adapter, D3DDEVTYPE CheckType, D3DFORMAT DisplayFormat, D3DFORMAT BackBufferFormat, BOOL Windowed) PURE; STDMETHOD(CheckDeviceType)(THIS_ UINT Adapter, D3DDEVTYPE CheckType, D3DFORMAT DisplayFormat, D3DFORMAT BackBufferFormat, BOOL Windowed) PURE;
STDMETHOD(CheckDeviceFormat)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat) PURE; STDMETHOD(CheckDeviceFormat)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat) PURE;
STDMETHOD(CheckDeviceFormatConversion)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat) PURE; STDMETHOD(CheckDeviceFormatConversion)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat) PURE;
STDMETHOD(GetDeviceCaps)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, void * pCaps) PURE; STDMETHOD(GetDeviceCaps)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, WINED3DCAPS* pCaps) PURE;
STDMETHOD(CreateDevice)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType,HWND hFocusWindow, DWORD BehaviorFlags, WINED3DPRESENT_PARAMETERS * pPresentationParameters, IWineD3DDevice ** ppReturnedDeviceInterface, IUnknown *parent, D3DCB_CREATERENDERTARGETFN pFn) PURE; STDMETHOD(CreateDevice)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType,HWND hFocusWindow, DWORD BehaviorFlags, WINED3DPRESENT_PARAMETERS * pPresentationParameters, IWineD3DDevice ** ppReturnedDeviceInterface, IUnknown *parent, D3DCB_CREATERENDERTARGETFN pFn) PURE;
}; };
#undef INTERFACE #undef INTERFACE
...@@ -255,6 +265,11 @@ DECLARE_INTERFACE_(IWineD3DDevice,IUnknown) ...@@ -255,6 +265,11 @@ DECLARE_INTERFACE_(IWineD3DDevice,IUnknown)
STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD * pValue) PURE; STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD * pValue) PURE;
STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value) PURE; STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value) PURE;
STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD * pValue) PURE; STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD * pValue) PURE;
STDMETHOD(SetTexture)(THIS_ DWORD Stage, IWineD3DBaseTexture* pTexture) PURE;
STDMETHOD(GetTexture)(THIS_ DWORD Stage, IWineD3DBaseTexture** ppTexture) PURE;
STDMETHOD(GetBackBuffer)(THIS_ UINT iSwapChain, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IWineD3DSurface** ppBackBuffer) PURE;
STDMETHOD(GetDeviceCaps)(THIS_ WINED3DCAPS* pCaps) PURE;
STDMETHOD(GetDisplayMode)(THIS_ UINT iSwapChain, D3DDISPLAYMODE* pMode) PURE;
STDMETHOD(BeginScene)(THIS) PURE; STDMETHOD(BeginScene)(THIS) PURE;
STDMETHOD(EndScene)(THIS) PURE; STDMETHOD(EndScene)(THIS) PURE;
STDMETHOD(Present)(THIS_ CONST RECT * pSourceRect,CONST RECT * pDestRect,HWND hDestWindowOverride,CONST RGNDATA * pDirtyRegion) PURE; STDMETHOD(Present)(THIS_ CONST RECT * pSourceRect,CONST RECT * pDestRect,HWND hDestWindowOverride,CONST RGNDATA * pDirtyRegion) PURE;
...@@ -311,6 +326,11 @@ DECLARE_INTERFACE_(IWineD3DDevice,IUnknown) ...@@ -311,6 +326,11 @@ DECLARE_INTERFACE_(IWineD3DDevice,IUnknown)
#define IWineD3DDevice_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b) #define IWineD3DDevice_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b)
#define IWineD3DDevice_SetTextureStageState(p,a,b,c) (p)->lpVtbl->SetTextureStageState(p,a,b,c) #define IWineD3DDevice_SetTextureStageState(p,a,b,c) (p)->lpVtbl->SetTextureStageState(p,a,b,c)
#define IWineD3DDevice_GetTextureStageState(p,a,b,c) (p)->lpVtbl->GetTextureStageState(p,a,b,c) #define IWineD3DDevice_GetTextureStageState(p,a,b,c) (p)->lpVtbl->GetTextureStageState(p,a,b,c)
#define IWineD3DDevice_SetTexture(p,a,b) (p)->lpVtbl->SetTexture(p,a,b)
#define IWineD3DDevice_GetTexture(p,a,b) (p)->lpVtbl->GetTexture(p,a,b)
#define IWineD3DDevice_GetBackBuffer(p,a,b,c,d) (p)->lpVtbl->GetBackBuffer(p,a,b,c,d)
#define IWineD3DDevice_GetDeviceCaps(p,a) (p)->lpVtbl->GetDeviceCaps(p,a)
#define IWineD3DDevice_GetDisplayMode(p,a,b) (p)->lpVtbl->GetDisplayMode(p,a,b)
#define IWineD3DDevice_BeginScene(p) (p)->lpVtbl->BeginScene(p) #define IWineD3DDevice_BeginScene(p) (p)->lpVtbl->BeginScene(p)
#define IWineD3DDevice_EndScene(p) (p)->lpVtbl->EndScene(p) #define IWineD3DDevice_EndScene(p) (p)->lpVtbl->EndScene(p)
#define IWineD3DDevice_Present(p,a,b,c,d) (p)->lpVtbl->Present(p,a,b,c,d) #define IWineD3DDevice_Present(p,a,b,c,d) (p)->lpVtbl->Present(p,a,b,c,d)
......
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