Description

Each of the mlib_GraphicsFillTriangleFanSet_*() functions draws a set of filled triangles with vertices at {(x1,y1), (x2,y2), (x3,y3)}, {(x1,y1), (x3,y3), (x4,y4)}, ..., and {(x1,y1), (xn-1,yn-1), (xn,yn)}.

Each of the mlib_GraphicsFillTriangleFanSet_X_*() functions draws a set of filled triangles in Xor mode as follows:

data[x,y] ^= c ^ c2

Each of the mlib_GraphicsFillTriangleFanSet_A_*() functions draws a set of filled triangles with antialiasing.

Each of the mlib_GraphicsFillTriangleFanSet_B_*() functions draws a set of filled triangles with alpha blending as follows:

data[x,y] = (data[x,y] * (255 - a) + c * a) / 255

Each of the mlib_GraphicsFillTriangleFanSet_G_*() functions draws a set of filled triangles with Gouraud shading.

Each of the mlib_GraphicsFillTriangleFanSet_Z_*() functions draws a set of filled triangles with Z buffering.

Each of the other functions draws a set of filled triangles with a combination of two or more features like antialiasing (A), alpha blending (B), Gouraud shading (G), and Z buffering (Z).

Parameters

Each of the functions takes some of the following arguments:

buffer

Pointer to the image into which the function is drawing.

zbuffer

Pointer to the image that holds the Z buffer.

x

Pointer to array of X coordinates of the points.

y

Pointer to array of Y coordinates of the points.

z

Pointer to array of Z coordinates of the points.

npoints

Number of points in the arrays.

c

Color used in the drawing, or pointer to array of colors of the points in the case of Gouraud shading.

c2

Alternation color.

a

Alpha value for blending. 0 ≤ a ≤ 255.

Return Values

Each of the functions returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE.