D3DXLoadVolumeFromFile
Loads a volume from a file.
HRESULT D3DXLoadVolumeFromFile(
LPDIRECT3DVOLUME8 pDestVolume,
CONST PALETTEENTRY* pDestPalette,
CONST D3DBOX* pDestBox,
LPCTSTR pSrcFile,
CONST D3DBOX* pSrcBox,
DWORD Filter,
D3DCOLOR ColorKey,
D3DXIMAGE_INFO* pSrcInfo
);
Parameters
- pDestVolume
- [in] Pointer to an IDirect3DVolume8 interface. Specifies the destination volume.
- pDestPalette
- [in] Pointer to a PALETTEENTRY structure, the destination palette of 256 colors or NULL.
- pDestBox
- [in] Pointer to a D3DBOX structure. Specifies the destination box. Set this parameter to NULL to specify the entire volume.
- pSrcFile
- [in] Pointer to a string that specifies the file name of the source image.
- pSrcBox
- [in] Pointer to a D3DBOX structure. Specifies the source box. Set this parameter to NULL to specify the entire volume.
- Filter
- [in] A combination of one or more D3DX_FILTER flags 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] 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 colorkeys. Thus, for opaque black, the value would be equal to 0xFF000000.
- pSrcInfo
- [in, out] Pointer to a D3DXIMAGE_INFO structure to be filled with a description of the data in the source image file, or NULL.
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.
Remarks
This function supports the following file formats: .bmp, .dds, .dib, .jpg, .png, and .tga.
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 surface was not already dirty (this is unlikely under normal usage scenarios), the application needs to explicitly call IDirect3DVolumeTexture8::AddDirtyBox on the surface.
This functions supports both Unicode and ANSI strings.
Requirements
Header: Declared in D3dx8tex.h.
Import Library: Use D3dx8.lib.
See Also
D3DXLoadVolumeFromFileInMemory,
D3DXLoadVolumeFromMemory,
D3DXLoadVolumeFromResource,
D3DXLoadVolumeFromVolume