gradient_fill


bool gradient_fill(handle device,
                   trivertex* trivertex_array,
                   unsigned vertices,
                   void* mesh,
                   unsigned elements,
                   unsigned mode)

This function fills triangle or rectangle structures.

Parameters

handle device

The handle of the device context in which the fill occurs.

trivertex* trivertex_array

A pointer to an array of structures defining position and color information.

unsigned vertices

The number of vertices present in the preceding array.

void* mesh

A pointer to an array of triangle or rectangle structures (depending upon the mode in effect). If rectangles are being filled the array consists of objects of the class gradient_rectangle; otherwise, the array consists of objects of the class gradient_triangle.

unsigned elements

The number of elements in the array specified by the previous parameter.

unsigned mode

The mode used to perform the gradient fill. This may be one of the values from the enumeration gradient_fill_flag.

Return

bool

true The function succeeded.
false The function was unsuccessful.

Notes

This function uses a mesh to specify the endpoints of the object to draw. all vertices are passed to the function in the array pointed to by the parameter Trivertexarray. The parameter Mesh specifies how these vertices are connected to form an object.

When filling rectangles, Mesh points to an array of objects of the class gradient_rectangle. Each object specifies the index of two vertices in the array Trivertexarray. These two vertices form the upper-left and lower-right corners of one rectangle.

When filling triangles, the parameter Mesh points to an array of objects of the class gradient_triangle. Each object specifies the index of three vertices in the array trivertex_array. These three vertices form one triangle.