---
name: "ggiClose"
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/ggiOpen/3ggi"
---

# ggiClose(3ggi)

Open and close a visual

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

## NAME

ggiOpen, ggiClose - Open and close a visual

## SYNOPSIS

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

**ggi\_visual\_t ggiOpen(const char \****display***,**  *...***);**

**int ggiClose(ggi\_visual\_t** *vis***);** .SH "DESCRIPTION"

**ggiOpen** opens a visual. The visual is specified as a display string, followed by **NULL**. If only **NULL** is specified, the default display target is opened. (This may be may be specified by the user.)

The other arguments are for internal purposes only, such as *argptr*, used to pass driver-specific, non-textual information to the driver.

**ggiClose** releases and destroys an open visual. This will close X windows, return consoles to text-mode, etc.

## RETURN VALUE

**ggiOpen** returns the opened visual (**ggi\_visual\_t**), or NULL for error.

**ggiClose** returns 0 for OK, otherwise an error code.

## EXAMPLES

### OPEN AND CLOSING DEFAULT VISUAL

```
ggi_visual_t vis = ggiOpen(NULL);
if(vis==NULL)
{
        ggiPanic("Couldn't open default visual!\n");
}
/* do stuff */
ggiClose(vis);

```

### OPEN AND CLOSING A MEMORY VISUAL

```
ggi_visual_t memvis = ggiOpen("display-memory", NULL);
if(memvis==NULL) {
        return -1;
}
/* do stuff */
ggiClose(memvis);

```

## SEE ALSO

[**ggiInit**(3)](/ggiInit/3.md)
