IDirect3DDevice9::CreateVolumeTexture method (d3d9helper.h)

Creates a volume texture resource.

Syntax

HRESULT CreateVolumeTexture(
  [in]          UINT                    Width,
  [in]          UINT                    Height,
  [in]          UINT                    Depth,
  [in]          UINT                    Levels,
  [in]          DWORD                   Usage,
  [in]          D3DFORMAT               Format,
  [in]          D3DPOOL                 Pool,
  [out, retval] IDirect3DVolumeTexture9 **ppVolumeTexture,
  [in]          HANDLE                  *pSharedHandle
);

Parameters

[in] Width

Type: UINT

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. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in D3DCAPS9.

[in] Height

Type: UINT

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. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in D3DCAPS9.

[in] Depth

Type: UINT

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. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in D3DCAPS9.

[in] Levels

Type: UINT

Number of levels in the texture. If this is zero, 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.

[in] Usage

Type: DWORD

Usage can be 0, which indicates no usage value. If usage is desired, use D3DUSAGE_DYNAMIC or D3DUSAGE_SOFTWAREPROCESSING. For more information, see D3DUSAGE.

[in] Format

Type: D3DFORMAT

Member of the D3DFORMAT enumerated type, describing the format of all levels in the volume texture.

[in] Pool

Type: D3DPOOL

Member of the D3DPOOL enumerated type, describing the memory class into which the volume texture should be placed.

[out, retval] ppVolumeTexture

Type: IDirect3DVolumeTexture9**

Address of a pointer to an IDirect3DVolumeTexture9 interface, representing the created volume texture resource.

[in] pSharedHandle

Type: HANDLE*

Reserved. Set this parameter to NULL. This parameter can be used in Direct3D 9 for Windows Vista to share resources.

Return value

Type: HRESULT

If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be one of the following: D3DERR_INVALIDCALL, D3DERR_OUTOFVIDEOMEMORY, E_OUTOFMEMORY.

Requirements

   
Target Platform Windows
Header d3d9helper.h (include D3D9.h)
Library D3D9.lib

See also

D3DXCreateVolumeTexture

D3DXCreateVolumeTextureFromFile

D3DXCreateVolumeTextureFromFileEx

D3DXCreateVolumeTextureFromFileInMemory

D3DXCreateVolumeTextureFromFileInMemoryEx

D3DXCreateVolumeTextureFromResource

D3DXCreateVolumeTextureFromResourceEx

IDirect3DDevice9