Graphic Context

LibGGI has a current context associated with each visual. This is done for performance reasons, as LibGGI can set up pointers to optimized functions when the GC changes (which can be monitored, as it may only be changed by the functions mentioned below).

int ggiSetGCForeground(ggi_visual_t vis,ggi_pixel color);
int ggiSetGCBackground(ggi_visual_t vis,ggi_pixel color);
These set the current colors for the foreground (used in all normal graphics functions) and the background (which is used in some 2-color operations like drawing texts).

int ggiGetGCForeground(ggi_visual_t vis,ggi_pixel *color);
int ggiGetGCBackground(ggi_visual_t vis,ggi_pixel *color);
These read the current colors for the foreground (used in all normal graphics functions) and the background (which is used in some 2-color operations like drawing texts). The return value is 0 for success, negative for failure. The requested color is stored in * color.

int ggiSetGCClipping(ggi_visual_t vis,int  left,int  top,int  right,int  bottom);
int ggiGetGCClipping(ggi_visual_t vis,int *left,int *top,int *right,int *bottom);
Set/Get the clipping rectangle used by all libggi drawing functions.
Return Code: 0 for O.K. or error code else.
Example: see FIXME.