## Presentation Device Driver Reference for OS/2

[prev][next][parent][TOC]

### GrePolyLine - Syntax

Simulation support:

None. This function is mandatory for all drivers.

Description:

GrePolyLine draws a sequence of one or more lines starting at the current ( X,Y) position. As each line is drawn, its end point becomes the start point for the next line. Upon completion, the current (X,Y) position is the end point of the last line.

For performance reasons, all presentation drivers should support this function when drawing a polyline to a single clipping rectangle. When the clip region is more complex, the handling routine can forward the call to the graphics engine using the pointer supplied in the dispatch table when the presentation driver was enabled. The engine will clip each line and return it to the presentation driver as a call to GreDrawLinesInPath.

GrePolyLine is called by the function GpiPolyLine. GrePolyLine is also used by many of the complex object-rendering routines within the graphics engine .

    #define INCL_GRE_LINES

    #include <os2.h>

    HDC        hdc;         /*  Device context handle. */

    PPOINTL    paptlPoint;  /*  Pointer to an array of (X,Y) points. */

    LONG       cPoints;     /*  Number of (X,Y) pairs in points array. */

    PVOID      pInstance;   /*  Pointer to instance data. */

    ULONG      lFunction;   /*  High-order WORD=flags; low-order WORD=NGrePolyLine. */

    LONG       rc;          /*  Return Code. */

    rc = GrePolyLine(hdc, paptlPoint, cPoints,

           pInstance, lFunction);