D3DXCreateVolumeTexture function

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

Syntax

HRESULT D3DXCreateVolumeTexture(
  _In_  LPDIRECT3DDEVICE9        pDevice,
  _In_  UINT                     Width,
  _In_  UINT                     Height,
  _In_  UINT                     Depth,
  _In_  UINT                     MipLevels,
  _In_  DWORD                    Usage,
  _In_  D3DFORMAT                Format,
  _In_  D3DPOOL                  Pool,
  _Out_ LPDIRECT3DVOLUMETEXTURE9 *ppVolumeTexture
);

Parameters

pDevice [in]

Type: LPDIRECT3DDEVICE9

Pointer to an IDirect3DDevice9 interface, representing the device to be associated with the volume texture.

Width [in]

Type: UINT

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]

Type: UINT

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]

Type: UINT

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]

Type: UINT

Number of mip levels requested. If this value is zero or D3DX_DEFAULT, a complete mipmap chain is created.

Usage [in]

Type: DWORD

0 or D3DUSAGE_DYNAMIC. For more information about using dynamic textures, see Using Dynamic Textures.

Format [in]

Type: D3DFORMAT

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]

Type: D3DPOOL

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

ppVolumeTexture [out]

Type: LPDIRECT3DVOLUMETEXTURE9*

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

Return value

Type: HRESULT

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

Remarks

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

Requirements

Requirement Value
Header
D3dx9tex.h
Library
D3dx9.lib

See also

Texture Functions in D3DX 9