Expand Minimize

D3DXLoadVolumeFromResource function

Loads a volume from a resource.

Syntax


HRESULT D3DXLoadVolumeFromResource(
  _In_  LPDIRECT3DVOLUME9 pDestVolume,
  _In_  const PALETTEENTRY *pDestPalette,
  _In_  const D3DBOX *pDestBox,
  _In_  HMODULE hSrcModule,
  _In_  LPCSTR pSrcResource,
  _In_  const D3DBOX *pSrcBox,
  _In_  DWORD Filter,
  _In_  D3DCOLOR ColorKey,
  _In_  D3DXIMAGE_INFO *pSrcInfo
);

Parameters

pDestVolume [in]

Type: LPDIRECT3DVOLUME9

Pointer to an IDirect3DVolume9 interface. Specifies the destination volume.

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.

hSrcModule [in]

Type: HMODULE

Handle to the module where the resource is located, or NULL for module associated with the image the operating system used to create the current process.

pSrcResource [in]

Type: LPCSTR

Pointer to a string that specifies the file name of the source image. If UNICODE or _UNICODE are defined, this parameter type is LPCWSTR, otherwise, the type is LPCSTR.

pSrcBox [in]

Type: const D3DBOX*

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

Filter [in]

Type: DWORD

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.

pSrcInfo [in]

Type: D3DXIMAGE_INFO*

Pointer to a D3DXIMAGE_INFO structure to be filled with a description of the data in the source image file, or NULL.

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

The resource being loaded must be a bitmap resource(RT_BITMAP).

This function handles conversion to and from compressed texture formats.

Writing to a non-level-zero surface of the volume texture will not cause the dirty rectangle to be updated. If D3DXLoadVolumeFromFile 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.

This function supports both Unicode and ANSI strings.

Requirements

Header

D3dx9tex.h

Library

D3dx9.lib

See also

D3DXLoadVolumeFromFile
D3DXLoadVolumeFromFileInMemory
D3DXLoadVolumeFromMemory
D3DXLoadVolumeFromVolume
Texture Functions in D3DX 9

 

 

Community Additions

ADD
Show:
© 2015 Microsoft