Share via


VolumeTexture.VolumeTexture(Device,Int32,Int32,Int32,Int32,Usage,Format,Pool) Constructor (Microsoft.DirectX.Direct3D)

Creates a new instance of the VolumeTexture class.

Definition

Visual Basic Public Sub New( _
    ByVal device As Device, _
    ByVal width As Integer, _
    ByVal height As Integer, _
    ByVal depth As Integer, _
    ByVal numLevels As Integer, _
    ByVal usage As Usage, _
    ByVal format As Format, _
    ByVal pool As Pool _
)
C# public VolumeTexture(
    Device device,
    int width,
    int height,
    int depth,
    int numLevels,
    Usage usage,
    Format format,
    Pool pool
);
C++ public:
 VolumeTexture(
    Devicedevice,
    int width,
    int height,
    int depth,
    int numLevels,
    Usage usage,
    Format format,
    Pool pool
);
JScript public function VolumeTexture(
    device : Device,
    width : int,
    height : int,
    depth : int,
    numLevels : int,
    usage : Usage,
    format : Format,
    pool : Pool
);

Parameters

device Microsoft.DirectX.Direct3D.Device
A Device object to associate with the VolumeTexture object.
width System.Int32
Width of the top level of the volume texture, in pixels. This value must be a power of two if the Caps.TextureCaps.SupportsVolumeMapPower2 member is set. See Remarks.
height System.Int32
Height of the top level of the volume texture, in pixels. This value must be a power of two if the Caps.TextureCaps.SupportsVolumeMapPower2 member is set. See Remarks.
depth System.Int32
Depth of the top level of the volume texture, in pixels. This value must be a power of two if the Caps.TextureCaps.SupportsVolumeMapPower2 member is set. See Remarks.
numLevels System.Int32
Number of levels in the texture. If this value is 0, Microsoft Direct3D generates all texture sublevels down to 1x1 pixels for hardware that supports mipmapped volume textures. Check the BaseTexture.LevelCount parameter for the number of levels generated.
usage Microsoft.DirectX.Direct3D.Usage
Usage type for this VolumeTexture.
format Microsoft.DirectX.Direct3D.Format
Member of the Format enumerated type that describes the format of all levels in the volume texture.
pool Microsoft.DirectX.Direct3D.Pool
Member of the Pool enumerated type that describes the memory class into which the volume texture should be placed.

Remarks

For the width, height, and depth parameters, the pixel dimensions of subsequent levels are 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 is taken instead. The maximum dimension that a driver supports (for width, height, and depth) can be found in Caps.MaxVolumeExtent.

Exceptions

InvalidCallException

The method call is invalid. For example, a parameter might contain an invalid value.

OutOfVideoMemoryException

Direct3D does not have enough display memory to perform the operation.

OutOfMemoryExceptionLeave Site

Direct3D could not allocate sufficient memory to complete the call.