IDirect3DDevice9::CreateVolumeTexture method
Creates a volume texture resource.
Syntax
HRESULT CreateVolumeTexture( [in] UINT Width, [in] UINT Height, [in] UINT Depth, [in] UINT Levels, [in] DWORD Usage, [in] D3DFORMAT Format, [in] D3DPOOL Pool, [out, retval] IDirect3DVolumeTexture9 **ppVolumeTexture, [in] HANDLE *pSharedHandle );
Parameters
- Width [in]
-
Type: UINT
Width of the top-level of the volume texture, in pixels. This value must be a power of two if the D3DPTEXTURECAPS_VOLUMEMAP_POW2 member of D3DCAPS9 is set. The pixel dimensions of subsequent levels will be the truncated value of half of the previous level's pixel dimension (independently). Each dimension clamps at a size of 1 pixel. Thus, if the division by two results in 0 (zero), 1 will be taken instead. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in D3DCAPS9.
- Height [in]
-
Type: UINT
Height of the top-level of the volume texture, in pixels. This value must be a power of two if the D3DPTEXTURECAPS_VOLUMEMAP_POW2 member of D3DCAPS9 is set. The pixel dimensions of subsequent levels will be the truncated value of half of the previous level's pixel dimension (independently). Each dimension clamps at a size of 1 pixel. Thus, if the division by 2 results in 0 (zero), 1 will be taken instead. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in D3DCAPS9.
- Depth [in]
-
Type: UINT
Depth of the top-level of the volume texture, in pixels. This value must be a power of two if the D3DPTEXTURECAPS_VOLUMEMAP_POW2 member of D3DCAPS9 is set. The pixel dimensions of subsequent levels will be the truncated value of half of the previous level's pixel dimension (independently). Each dimension clamps at a size of 1 pixel. Thus, if the division by 2 results in 0 (zero), 1 will be taken instead. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in D3DCAPS9.
- Levels [in]
-
Type: UINT
Number of levels in the texture. If this is zero, Direct3D will generate all texture sublevels down to 1x1 pixels for hardware that supports mipmapped volume textures. Call IDirect3DBaseTexture9::GetLevelCount to see the number of levels generated.
- Usage [in]
-
Type: DWORD
Usage can be 0, which indicates no usage value. If usage is desired, use D3DUSAGE_DYNAMIC or D3DUSAGE_SOFTWAREPROCESSING. For more information, see D3DUSAGE.
- Format [in]
-
Type: D3DFORMAT
Member of the D3DFORMAT enumerated type, describing the format of all levels in the 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, retval]
-
Type: IDirect3DVolumeTexture9**
Address of a pointer to an IDirect3DVolumeTexture9 interface, representing the created volume texture resource.
- pSharedHandle [in]
-
Type: HANDLE*
Reserved. Set this parameter to NULL. This parameter can be used in Direct3D 9 for Windows Vista to share resources.
Return value
Type: HRESULT
If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be one of the following: D3DERR_INVALIDCALL, D3DERR_OUTOFVIDEOMEMORY, E_OUTOFMEMORY.
Requirements
|
Header |
|
|---|---|
|
Library |
|
See also
- IDirect3DDevice9
- D3DXCreateVolumeTexture
- D3DXCreateVolumeTextureFromFile
- D3DXCreateVolumeTextureFromFileEx
- D3DXCreateVolumeTextureFromFileInMemory
- D3DXCreateVolumeTextureFromFileInMemoryEx
- D3DXCreateVolumeTextureFromResource
- D3DXCreateVolumeTextureFromResourceEx