Supported Browsers Home   
MGL_fillPolygonCnvxFX Previous   
MGL_fillRect Next   
External Functions Up   

MGL_fillPolygonFX

Fills an arbitrary polygon.

Declaration

void MGLAPI MGL_fillPolygonFX(
    int count,
    fxpoint_t *vArray,
    int vinc,
    fix32_t xOffset,
    fix32_t yOffset)

Prototype In

mgraph.h

Parameters

count

Number of vertices in polygon

vArray

Array of vertices in polygon

vinc

Increment to get to next vertex in bytes

xOffset

x coordinate offset value

yOffset

y coordinate offset value

 

Description

These routines rasterize a filled arbitrary polygon in the current color and style. By default the routine will determine the type of the polygon being rasterized, and will rasterize convex polygons using a faster scan conversion routine, otherwise a general polygon scan conversion routine will be used. Thus you can rasterize any type of polygon that you desire.

A convex polygon is defined as a polygon such that every horizontal line drawn through the polygon would cross exactly two active edges (neither horizontal lines nor zero-length edges count as active edges; both are acceptable anywhere in the polygon). Right & left edges may cross (polygons may be non-simple).

Non-simple or self intersecting polygons will be rasterized using the standard in/out rule, where points are defined as being inside after crossing the first edge in the polygon, and then alternate between defined as inside then outside after crossing subsequent active edges in the polygon.

You may also use the MGL_setPolygonType routine to specify the type of polygons being rasterized. This may be MGL_AUTO_POLYGON, MGL_CONVEX_POLYGON or MGL_COMPLEX_POLYGON. Explicitly setting the polygon type will speed the drawing process.

As with all MGL polygon rasterizing routines, this routine does not rasterize the pixels down the right hand side or the bottom edges of the polygon. This ensures that pixels along shared edges of polygons are not rasterized twice, which can cause annoying pixel flashes in animation code. Note also that the edges in the polygon will always be rasterized from top to bottom, to ensure that all shared edges will actually generate the same set of vertices, eliminating the possibility of pixel dropouts between shared edges in polygons.

Note:    All vertices are offset by (xOffset,yOffset).

See Also

MGL_setPolygonType

Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com