Draw a rectangle
int PgDrawRect( PhRect_t const *rect, unsigned int flags ); int PgDrawIRect( int ulx, int uly, int lrx, int lry, unsigned int flags );
These functions build a command in the draw buffer to draw a rectangle. Note that PgDrawRect() requires a pointer to a PhRect_t structure whereas PgDrawIRect() takes individual arguments.
The flags argument must be one of the following:
For PgDrawIRect(), ulx and uly are the coordinates of the upper-left corner, and lrx and lry are those for the lower-right.
The following example:
DrawFillRect() { PgSetFillColor( Pg_PURPLE ); PgDrawIRect( 8, 8, 152, 112, Pg_DRAW_FILL ); }
will draw:
The following example:
DrawStrokeRect() { PgSetStrokeColor( Pg_WHITE ); PgDrawIRect( 8, 8, 152, 112, Pg_DRAW_STROKE ); }
will draw:
The following example:
DrawFillStrokeRect() { PgSetFillColor( Pg_PURPLE ); PgSetStrokeColor( Pg_WHITE ); PgDrawIRect( 8, 8, 152, 112, Pg_DRAW_FILL_STROKE ); }
will draw:
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
PgDrawBeveled(), PgDrawRoundRect(), PgSetFillColor(), PgSetFillDither(), PgSetFillTransPat()