Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/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.

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

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.

Copy Code
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::DrawPrimitiveto render this line list:

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

See Also