D3DXCreateVolumeTexture
Microsoft DirectX 9.0 SDK Update (October 2004)

D3DXCreateVolumeTexture Function


Creates an empty volume texture, adjusting the calling parameters as needed.

Syntax

HRESULT WINAPI D3DXCreateVolumeTexture(      

    LPDIRECT3DDEVICE9 pDevice,     UINT Width,     UINT Height,     UINT Depth,     UINT MipLevels,     DWORD Usage,     D3DFORMAT Format,     D3DPOOL Pool,     LPDIRECT3DVOLUMETEXTURE9 *ppVolumeTexture );

Parameters

pDevice
[in] Pointer to an IDirect3DDevice9 interface, representing the device to be associated with the volume texture.
Width
[in] Width in pixels. This value must be nonzero. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in D3DCAPS9.
Height
[in] Height in pixels. This value must be nonzero. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in D3DCAPS9.
Depth
[in] Depth in pixels. This value must be nonzero. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in D3DCAPS9.
MipLevels
[in] Number of mip levels requested. If this value is zero or D3DX_DEFAULT, a complete mipmap chain is created.
Usage
[in] 0 or D3DUSAGE_DYNAMIC. For more information about using dynamic textures, see Using Dynamic Textures.
Format
[in] Member of the D3DFORMAT enumerated type, describing the requested pixel format for the volume texture. The returned volume texture might have a different format from that specified by Format. Applications should check the format of the returned volume texture.
Pool
[in] Member of the D3DPOOL enumerated type, describing the memory class into which the volume texture should be placed.
ppVolumeTexture
[out] Address of a pointer to an IDirect3DVolumeTexture9 interface, representing the created volume texture object.

Return Value

If the function succeeds, the return value is D3D_OK.

If the function fails, the return value can be one of the following:

D3DERR_NOTAVAILABLEThis device does not support the queried technique.
D3DERR_OUTOFVIDEOMEMORYMicrosoft Direct3D does not have enough display memory to perform the operation.
D3DERR_INVALIDCALLThe method call is invalid. For example, a method's parameter may have an invalid value.
E_OUTOFMEMORYDirect3D could not allocate sufficient memory to complete the call.


Remarks

Internally, D3DXCreateVolumeTexture uses D3DXCheckVolumeTextureRequirements to adjust the calling parameters. Therefore, calls to D3DXCreateVolumeTexture will often succeed where calls to IDirect3DDevice9::CreateVolumeTexture would fail.

Function Information

Headerd3dx9tex.h
Import libraryd3dx9.lib
Minimum operating systems Windows 98

See Also

Texture Support in D3DX


© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.