---
name: "ggiSetGraphMode"
section: "3ggi"
platform: "linux"
package: "libggi2-dev"
version: "1:2.0.1-2"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/ggiSetMode/3ggi"
---

# ggiSetGraphMode(3ggi)

Set or get a mode on a visual

Part of [ggiSetMode(3ggi)](/ggiSetMode/3ggi.md).

## NAME

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

## SYNOPSIS

**#include \<ggi/ggi.h\>**

**int ggiSetMode(ggi\_visual\_t** *vis***, 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** *x***, int** *y***,**  **int** *frames***,**  **ggi\_graphtype** *type***);**

**int ggiGetMode(ggi\_visual\_t** *vis***, ggi\_mode \****tm***);** .SH "DESCRIPTION"

**ggiSetMode** sets any mode (text or graphics). It also performs mode negotiation like **ggiCheckMode**, 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**,  **ggiSetSimpleMode** are convenient versions of **ggiSetMode** that take the mode paramters as integer arguments rather than as a **ggi\_mode** 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** cannot be seen.

**ggiGetMode** fills out the passed **ggi\_mode** 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 error code.

## SEE ALSO

[**ggiOpen**(3)](/ggiOpen/3.md), [**ggiCheckMode**(3)](/ggiCheckMode/3.md)
