Partager via


Line Lists (Windows Embedded CE 6.0)

1/6/2010

A line list is a list of isolated, straight line segments. Line lists are useful for such tasks as adding sleet or heavy rain to a 3-D scene. Applications create a line list by filling an array of vertices, and the number of vertices in a line list must be an even number greater than or equal to two.

The following illustration shows a rendered line list.

Ee491437.94823c89-6b40-40f0-aeed-b756af6a4c72(en-US,WinEmbedded.60).gif

The line list primitive is identified by the D3DMPT_LINELIST element of the D3DMPRIMITIVETYPE enumeration.

You can apply materials and textures to a line list. The colors in the material or texture appear only along the lines drawn, not at any point in between the lines.

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

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 code example below shows how to use IDirect3DMobileDevice::DrawPrimitive to render this line list:

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

See Also

Concepts

Device-Supported Primitive Types