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_uint color); int ggiSetGCBackground(ggi_visual_t vis,ggi_uint 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_uint * color); int ggiGetGCBackground(ggi_visual_t vis,ggi_uint * 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.