Texture.Texture(Device,Stream,Usage,Pool) Constructor (Microsoft.DirectX.Direct3D)
Creates a new instance of the Texture class.
Definition
Visual Basic Public Sub New( _
ByVal device As Device, _
ByVal data As Stream, _
ByVal usage As Usage, _
ByVal pool As Pool _
)C# public Texture(
Device device,
Stream data,
Usage usage,
Pool pool
);C++ public:
Texture(
Device^ device,
Stream^ data,
Usage usage,
Pool pool
);JScript public function Texture(
device : Device,
data : Stream,
usage : Usage,
pool : Pool
);
Parameters
device Microsoft.DirectX.Direct3D.Device
A Device object to associate with the Texture.data System.IO.Stream
A Stream object that contains the image data. The texture is created with the data in the stream.usage Microsoft.DirectX.Direct3D.Usage
Usage can be 0, which indicates no usage value. However, if usage is desired, use one or more Usage constants. It is good practice to match the usage parameter with the CreateFlags in the Device constructor.pool Microsoft.DirectX.Direct3D.Pool
Member of the Pool enumerated type that describes the memory class into which the texture should be placed.
Remarks
An application can discover support for automatic generation of mipmaps in a particular format by calling Manager.CheckDeviceFormat with Usage.AutoGenerateMipMap. If Manager.CheckDeviceFormat returns false, the Texture constructor succeeds, but returns a single-level texture.
Exceptions
The method call is invalid. For example, a parameter might contain an invalid value.
Microsoft Direct3D does not have enough display memory to perform the operation.
Direct3D could not allocate sufficient memory to complete the call.
See Also