Microsoft DirectX 8.1 (C++)

D3DXCreateVolumeTexture

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

HRESULT D3DXCreateVolumeTexture(
  LPDIRECT3DDEVICE8 pDevice,
  UINT Width,
  UINT Height,
  UINT Depth,
  UINT MipLevels,
  DWORD Usage,
  D3DFORMAT Format,
  D3DPOOL Pool,
  LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture
);

Parameters

pDevice
[in] Pointer to an IDirect3DDevice8 interface, representing the device to be associated with the volume texture.
Width
[in] Width in pixels. This value must be non-zero.
Height
[in] Height in pixels. This value must be non-zero.
Depth
[in] Depth in pixels. This value must be non-zero.
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. Setting this value to D3DUSAGE_DYNAMIC indicates that the surface should be handled dynamically. 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 IDirect3DVolumeTexture8 interface, representing the created volume texture object.

Return Values

If the function succeeds, the return value is D3D_OK.

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

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 IDirect3DDevice8::CreateVolumeTexture would fail.

Requirements

  Header: Declared in D3dx8tex.h.
  Import Library: Use D3dx8.lib.