Lightweight Graphics

GGetClip

Get the drawing limit

Syntax

Signature
void GGetClip( int *top, int *left, int *bottom, int *right );

Arguments

top, left, bottom, right receive the inclusive clipping bounds in pixels. Pass NULL for a value you do not need.

Return value

No return value. All four values are zero when drawing is not limited.

Description

Reads the rectangle set by GSetClip(). The example saves the clip, draws with another one and restores the saved clip.

Example

ggetclip.c
#include "xdev-wtui.h"

int main( void )
{
   int top, left, bottom, right;

   GGetClip( &top, &left, &bottom, &right );
   GSetClip( 50, 50, 100, 150 );
   GRect( 0, 0, 200, 300, GMakeColor( 0, 0, 255 ), T );
   GSetClip( top, left, bottom, right );

   Inkey( 0, NIL );

   return 0;
}

See also