Devices

A Microsoft Direct3D device is the rendering component of Direct3D. It encapsulates and stores the rendering state. In addition, a Direct3D device performs transformations and lighting operations and rasterizes an image to a surface. The following topics provide further details on using devices.

Architecturally, Direct3D devices contain a transformation module, a lighting module, and a rasterizing module, as the following illustration shows.

Direct3D device architecture

Microsoft DirectX currently supports two main types of Direct3D devices: a hardware device with hardware-accelerated rasterization and shading with both hardware and software vertex processing; and a reference device.

You can think of these devices as two separate drivers. Software and reference devices are represented by software drivers, and the hardware device is represented by a hardware driver. The most common way to take advantage of these devices is to use the hardware device for shipping applications, and the reference device for feature testing. These are provided by third parties to emulate particular devices, for example, developmental hardware that has not yet been released.

The Direct3D device that an application creates must correspond to the capabilities of the hardware on which the application is running. Direct3D provides rendering capabilities, either by accessing 3-D hardware that is installed in the computer or by emulating the capabilities of 3-D hardware in software. Therefore, Direct3D provides devices for both hardware access and software emulation.

Hardware-accelerated devices give much better performance than software devices. The hardware device type is available on all Direct3D supported graphic adapters. In most cases, applications target computers that have hardware acceleration and rely on software emulation to accommodate lower-end computers.

With the exception of the reference device, software devices do not always support the same features as a hardware device. Applications should always query for device capabilities to determine which features are supported.

Because the behavior of the software and reference devices provided with DirectX 9.0 is identical to that of the hardware device, application code authored to work with the hardware device will work with the software or reference devices without modifications. Note that while the provided software or reference device behavior is identical to that of the hardware device, the device capabilities do vary, and a particular software device may implement a much smaller set of capabilities.

Behaviors

Direct3D enables you to specify the behavior of a device, as well the device type. The Device(Int32,DeviceType,IntPtr,CreateFlags,PresentParameters[]) method enables a combination of one or more of the CreateFlags behavior flags to control the global behaviors of the Direct3D device. These behaviors specify what is and is not maintained in the run-time portion of Direct3D, and the device types specify which driver to use. Although some combinations of device behaviors are not valid, it is possible to use all device behaviors with all device types. For example, it is valid to specify DeviceType.Software, which indicates a pluggable software device, with the device creation flag CreateFlags.PureDevice, which specifies that the device does not support vertex processing.