?/TD>
Microsoft DirectX 9.0

IDirect3DDevice9::CreateVolumeTexture Method


Creates a volume texture resource.

Syntax

HRESULT CreateVolumeTexture(      

    UINT Width,     UINT Height,     UINT Depth,     UINT Levels,     DWORD Usage,     D3DFORMAT Format,     D3DPOOL Pool,     IDirect3DVolumeTexture9** ppVolumeTexture,     HANDLE* pHandle );

Parameters

Width
[in] Width of the top-level of the volume texture, in pixels. This value must be a power of two if the D3DPTEXTURECAPS_VOLUMEMAP_POW2 member of D3DCAPS9 is set. The pixel dimensions of subsequent levels will be the truncated value of half of the previous level's pixel dimension (independently). Each dimension clamps at a size of 1 pixel. Thus, if the division by two results in 0 (zero), 1 will be taken instead.
Height
[in] Height of the top-level of the volume texture, in pixels. This value must be a power of two if the D3DPTEXTURECAPS_VOLUMEMAP_POW2 member of D3DCAPS9 is set. The pixel dimensions of subsequent levels will be the truncated value of half of the previous level's pixel dimension (independently). Each dimension clamps at a size of 1 pixel. Thus, if the division by 2 results in 0 (zero), 1 will be taken instead.
Depth
[in] Depth of the top-level of the volume texture, in pixels. This value must be a power of two if the D3DPTEXTURECAPS_VOLUMEMAP_POW2 member of D3DCAPS9 is set. The pixel dimensions of subsequent levels will be the truncated value of half of the previous level's pixel dimension (independently). Each dimension clamps at a size of 1 pixel. Thus, if the division by 2 results in 0 (zero), 1 will be taken instead.
Levels
[in] Number of levels in the texture. If this is zero, Microsoft?Direct3D?will generate all texture sublevels down to 1x1 pixels for hardware that supports mipmapped volume textures. Call IDirect3DBaseTexture9::GetLevelCount to see the number of levels generated.
Usage
[in] Usage can be 0, which indicates no usage value. If usage is desired, use D3DUSAGE_DYNAMIC or D3DUSAGE_SOFTWAREPROCESSING. For more information, see D3DUSAGE.
Format
[in] Member of the D3DFORMAT enumerated type, describing the format of all levels in the volume texture.
Pool
[in] Member of the D3DPOOL enumerated type, describing the memory class into which the volume texture should be placed.
ppVolumeTexture
[out, retval] Address of a pointer to an IDirect3DVolumeTexture9 interface, representing the created volume texture resource.
pHandle
[in] Reserved. Set this parameter to NULL.

Return Value

If the method succeeds, the return value is D3D_OK.

If the method fails, the return value can be one of the following values.

D3DERR_INVALIDCALLThe method call is invalid. For example, a method's parameter may have an invalid value.
D3DERR_OUTOFVIDEOMEMORYDirect3D does not have enough display memory to perform the operation.
E_OUTOFMEMORYDirect3D could not allocate sufficient memory to complete the call.




© 2002 Microsoft Corporation. All rights reserved.