Partager via


Line Strips

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

A line strip is a primitive that is composed of connected line segments. Your application can use line strips for creating polygons that are not closed. A closed polygon is a polygon whose last vertex is connected to its first vertex by a line segment. If your application makes polygons based on line strips, the vertices are not guaranteed to be coplanar.

The following illustration shows a rendered line strip.

Aa911032.d1bd5f78-bdc3-4708-8d86-c52eb91141b6(en-us,MSDN.10).gif

The line strip primitive is identified by the D3DMPT_LINESTRIP element of the D3DMPRIMITIVETYPE enumeration.

The following code example shows how to create vertices for this line strip.

struct CUSTOMVERTEX
{
    float x,y,z;
};

CUSTOMVERTEX Vertices[] = 
{
    {-5.0, -5.0, 0.0},
    { 0.0,  5.0, 0.0},
    { 5.0, -5.0, 0.0},
    {10.0,  5.0, 0.0},
    {15.0, -5.0, 0.0},
    {20.0,  5.0, 0.0}
};

The following code example shows how to use IDirect3DMobileDevice::DrawPrimitive to render this line strip.

//
// It is assumed that d3dmDevice is a valid
// pointer to a IDirect3DMobileDevice interface.
//
d3dmDevice->DrawPrimitive( D3DMPT_LINESTRIP, 0, 5 );

See Also

Concepts

Device-Supported Primitive Types