[Previous] [Contents] [Index] [Next]

PgDrawLine(), PgDrawILine()

Draw a single line

Synopsis:

int  PgDrawLine( PhPoint_t const *p1,
                 PhPoint_t const *p2 );

int  PgDrawILine( int x1, int y1,
                  int x2, int y2 );

Description:

These functions build a command in the draw buffer to draw a line. Note that PgDrawLine() requires two pointers to PhPoint_t, whereas PgDrawILine() takes individual arguments.

Returns:

0
Success.
-1
The draw buffer is too small to hold the current draw state and the draw command.

Examples:

The following example:

DrawLines() {
    PgSetStrokeColor( Pg_RED );
    PgDrawILine( 8, 8, 152, 8 );
    PgSetStrokeColor( Pg_GREEN );
    PgDrawILine( 8, 8, 152, 60 );
    PgSetStrokeColor( Pg_YELLOW );
    PgDrawILine( 8, 8, 152, 112 );
}

will draw:

PgDrawLine

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PgSetStrokeCap(), PgSetStrokeColor(), PgSetStrokeDash(), PgSetStrokeDither(), PgSetStrokeJoin(), PgSetStrokeWidth()


[Previous] [Contents] [Index] [Next]