Supporting Single-Pixel-Wide Antialiased Lines

A DirectX 9.0 version driver can support single-pixel-wide lines that are either alias or antialias. The driver indicates antialias support by setting the D3DLINECAPS_ANTIALIAS capability bit in the LineCaps member of the D3DCAPS9 structure. The driver returns a D3DCAPS9 structure in response to a GetDriverInfo2 query similarly to how it returns a D3DCAPS8 structure as described in Reporting DirectX 8.0 Style Direct3D Capabilities. Support of this query is described in Supporting GetDriverInfo2.

To enable line antialiasing, the driver receives the D3DDP2OP_RENDERSTATE operation code in the command stream of its D3dDrawPrimitives2 function. The driver processes the D3DRS_ANTIALIASEDLINEENABLE render state from the RenderState member of the D3DHAL_DP2RENDERSTATE structure that is associated with this operation code. The driver determines whether to enable or disable line antialiasing from the Boolean value in the dwState member of D3DHAL_DP2RENDERSTATE. The value TRUE means to enable and FALSE means to disable. By default, this render-state value is set to FALSE.

The D3DRS_ANTIALIASEDLINEENABLE render state applies to triangles drawn in wire-frame mode as well as line-drawing primitive types.

When rendering to a multiple-sample render target, the driver must ignore a request to enable line antialiasing and render all lines aliased.