D3DXLoadVolumeFromMemory function

Loads a volume from memory.

Syntax

HRESULT D3DXLoadVolumeFromMemory(
  _In_       LPDIRECT3DVOLUME9 pDestVolume,
  _In_ const PALETTEENTRY      *pDestPalette,
  _In_ const D3DBOX            *pDestBox,
  _In_       LPCVOID           pSrcMemory,
  _In_       D3DFORMAT         SrcFormat,
  _In_       UINT              SrcRowPitch,
  _In_       UINT              SrcSlicePitch,
  _In_ const PALETTEENTRY      *pSrcPalette,
  _In_ const D3DBOX            *pSrcBox,
  _In_       DWORD             Filter,
  _In_       D3DCOLOR          ColorKey
);

Parameters

pDestVolume [in]

Type: LPDIRECT3DVOLUME9

Pointer to an IDirect3DVolume9 interface. Specifies the destination volume, which receives the image.

pDestPalette [in]

Type: const PALETTEENTRY*

Pointer to a PALETTEENTRY structure, the destination palette of 256 colors or NULL.

pDestBox [in]

Type: const D3DBOX*

Pointer to a D3DBOX structure. Specifies the destination box. Set this parameter to NULL to specify the entire volume.

pSrcMemory [in]

Type: LPCVOID

Pointer to the top-left corner of the source volume in memory.

SrcFormat [in]

Type: D3DFORMAT

Member of the D3DFORMAT enumerated type, the pixel format of the source volume.

SrcRowPitch [in]

Type: UINT

Pitch of source image, in bytes. For DXT formats (compressed texture formats), this number should represent the size of one row of cells, in bytes.

SrcSlicePitch [in]

Type: UINT

Pitch of source image, in bytes. For DXT formats (compressed texture formats), this number should represent the size of one slice of cells, in bytes.

pSrcPalette [in]

Type: const PALETTEENTRY*

Pointer to a PALETTEENTRY structure, the source palette of 256 colors or NULL.

pSrcBox [in]

Type: const D3DBOX*

Pointer to a D3DBOX structure. Specifies the source box. NULL is not a valid value for this parameter.

Filter [in]

Type: DWORD

A combination of one or more D3DX_FILTER controlling how the image is filtered. Specifying D3DX_DEFAULT for this parameter is the equivalent of specifying D3DX_FILTER_TRIANGLE | D3DX_FILTER_DITHER.

ColorKey [in]

Type: D3DCOLOR

D3DCOLOR value to replace with transparent black, or 0 to disable the colorkey. This is always a 32-bit ARGB color, independent of the source image format. Alpha is significant and should usually be set to FF for opaque color keys. Thus, for opaque black, the value would be equal to 0xFF000000.

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 values: D3DERR_INVALIDCALL, D3DXERR_INVALIDDATA.

Remarks

Writing to a non-level-zero surface of the volume texture will not cause the dirty rectangle to be updated. If D3DXLoadVolumeFromMemory is called and the texture was not already dirty (this is unlikely under normal usage scenarios), the application needs to explicitly call IDirect3DVolumeTexture9::AddDirtyBox on the volume texture.

Requirements

Requirement Value
Header
D3dx9tex.h
Library
D3dx9.lib

See also

D3DXLoadVolumeFromFile

D3DXLoadVolumeFromResource

D3DXLoadVolumeFromVolume

Texture Functions in D3DX 9