Partager via


Setting the Number of Line Pattern Repetitions

Applications can direct a Direct3D device to render primitives using solid or patterned lines. Applications can also stretch a particular line pattern if the device supports repeating the pattern. The device's driver must set the D3DPMISCCAPS_LINEPATTERNREP flag to indicate that the device supports repeating a particular line pattern. How this flag is set depends on the DirectX version:

  • For DirectX 7.0 and earlier, set this flag in the dwMiscCaps member of the D3DPRIMCAPS structure.

  • For DirectX 8.0 and later, set this flag in the PrimitiveMiscCaps member of the D3DCAPSXx structure, where Xx indicates the DirectX version (for example, D3DCAPS8 for version 8 and D3DCAPS9 for version 9). D3DCAPS8 and D3DCAPS9 are described in their respective versions of the DirectX SDK documentation.

When applications set the render-state value for the D3DRENDERSTATE_LINEPATTERN (or D3DRS_LINEPATTERN) render state, they can specify the number of times to repeat the line pattern by setting the wRepeatFactor member of the D3DLINEPATTERN structure. Applications can set this member to a maximum value of 65535 (16-bit value). However, hardware only supports a maximum of 255 (8-bit value). Therefore, a display driver must fail a request that attempts to set the line-pattern-repetition number to a value greater than 255 as an invalid request. D3DLINEPATTERN is described in the DirectX SDK documentation.