From b4a90b0fe860785b98089c9d7ce20e3bff143379 Mon Sep 17 00:00:00 2001 From: Matteo Bruni Date: Mon, 8 Nov 2010 23:00:45 +0100 Subject: [PATCH] d3dx9: Implement D3DXCreateVolumeTexture. --- dlls/d3dx9_36/d3dx9_36.spec | 2 +- dlls/d3dx9_36/texture.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec index c20e2f98857..efe28c5eb8b 100644 --- a/dlls/d3dx9_36/d3dx9_36.spec +++ b/dlls/d3dx9_36/d3dx9_36.spec @@ -106,7 +106,7 @@ @ stub D3DXCreateTextureGutterHelper @ stub D3DXCreateTextureShader @ stub D3DXCreateTorus -@ stub D3DXCreateVolumeTexture +@ stdcall D3DXCreateVolumeTexture(ptr long long long long long long long ptr) @ stub D3DXCreateVolumeTextureFromFileA @ stub D3DXCreateVolumeTextureFromFileExA @ stub D3DXCreateVolumeTextureFromFileExW diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c index b191a348083..04422e5a471 100644 --- a/dlls/d3dx9_36/texture.c +++ b/dlls/d3dx9_36/texture.c @@ -905,3 +905,34 @@ HRESULT WINAPI D3DXCreateCubeTexture(LPDIRECT3DDEVICE9 device, return IDirect3DDevice9_CreateCubeTexture(device, size, miplevels, usage, format, pool, texture, NULL); } + +HRESULT WINAPI D3DXCreateVolumeTexture(LPDIRECT3DDEVICE9 device, + UINT width, + UINT height, + UINT depth, + UINT miplevels, + DWORD usage, + D3DFORMAT format, + D3DPOOL pool, + LPDIRECT3DVOLUMETEXTURE9 *texture) +{ + HRESULT hr; + + TRACE("(%p, %u, %u, %u, %u, %#x, %#x, %#x, %p)\n", device, width, height, depth, + miplevels, usage, format, pool, texture); + + if (!device || !texture) + return D3DERR_INVALIDCALL; + + hr = D3DXCheckVolumeTextureRequirements(device, &width, &height, &depth, + &miplevels, usage, &format, pool); + + if (FAILED(hr)) + { + TRACE("D3DXCheckVolumeTextureRequirements failed\n"); + return hr; + } + + return IDirect3DDevice9_CreateVolumeTexture(device, width, height, depth, miplevels, + usage, format, pool, texture, NULL); +}