ggiSetMode(3)

NAME
ggiSetMode, ggiSetTextMode, ggiSetGraphMode, ggiSetSimpleMode, ggiGetMode : Set or get a mode on a visual

SYNOPSIS
#include <ggi/ggi.h>
int ggiSetMode(ggi_visual_t visual, ggi_mode *tm);
int ggiSetTextMode(ggi_visual_t visual, int cols, int rows,
                   int vcols, int vrows, int fontx, int fonty,
                   ggi_graphtype type);
int ggiSetGraphMode(ggi_visual_t visual, int x, int y,
                    int xv, int yv, ggi_graphtype type);
int ggiSetSimpleMode(ggi_visual_t visual, int xsize, int ysize,
                     int frames, ggi_graphtype type);
int ggiGetMode(ggi_visual_t visual, ggi_mode *tm);

DESCRIPTION
ggiSetMode sets any mode (text or graphics). It also performs mode negotiation like ggiCheckMode(3), but if any non-GGI_AUTO/GT_AUTO parameters are changed from the original mode, the new mode will not be silently set. ggiSetTextMode, ggiSetGraphMode and ggiSetSimpleMode are convenient versions of ggiSetMode that take the mode parameters as integer arguments rather than as a ggi_mode(3) struct that the application has to fill out. Otherwise, they are functionally equivalent to ggiSetMode function, and the same mode-setting semantics apply, except the changed ggi_mode(3) cannot be seen. ggiGetMode fills out the passed ggi_mode(3) with the parameters of the current mode of the visual.

RETURN VALUE
The mode setting functions return 0 if the mode is set successfully, otherwise an ggi-error(3) code.

NOTES
Do not set a mode before checking it. You may be able to set up a certain mode on one target, but not other targets. See the example in ggiCheckMode(3)

SEE ALSO
ggiCheckMode(3), ggiOpen(3), ggi_mode(3)