---
name: "waffle_display"
section: "3"
platform: "linux"
package: "libwaffle-doc"
version: "1.8.1-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/waffle_display"
---

# waffle\_display(3)

class waffle\_display

## NAME

waffle\_display, waffle\_display\_connect, waffle\_display\_disconnect, waffle\_display\_supports\_context\_api, waffle\_display\_get\_native - class waffle\_display

## SYNOPSIS

```
#include <waffle.h>
struct waffle_display;
```

**struct waffle\_display\* waffle\_display\_connect(const char\*** *name***);**

**bool waffle\_display\_disconnect(struct waffle\_display \****self***);**

**bool waffle\_display\_supports\_context\_api(struct waffle\_display \****self***, int32\_t** *context\_api***);**

**union waffle\_native\_display\* waffle\_display\_get\_native(struct waffle\_display \****self***);**

## DESCRIPTION

**struct waffle\_display**

An opaque type.

**waffle\_display\_connect()**

Connect to a display. The interpretation of *name* differs according to the platform given to [**waffle\_init**(3)](/waffle_init/3.md).

On Android, CGL and WGL *name* is ignored.

On the X11 platforms, GLX and X11/EGL, the function connects to the X11 display with the given *name*. If *name* is null, then it uses the value of the environment variable **DISPLAY**.

On Wayland, the function connects to the Wayland display with the given name. If *name* is null, then it uses the value of the environment variable **WAYLAND\_DISPLAY**.

On GBM, the function opens the device at the filepath *name*. If *name* is NULL, then the function uses the value of environment variable **WAFFLE\_GBM\_DEVICE**. If *name* is null and **WAFFLE\_GBM\_DEVICE** is unset, then the function iterates using libdrm through the set of card devices in the drm subsystem, which are usually located in /dev/dri, and attempts to open each in turn with open(O\_RDWR \| O\_CLOEXEC) until successful.

**waffle\_display\_disconnect()**

Disconnect from the **waffle\_display** and release it's memory. All pointers to waffle objects that were created with the display become invalid.

**waffle\_display\_supports\_context\_api()**

Check if the display is capable of creating a [**waffle\_context**(3)](/waffle_context/3.md) with the given *context\_api*. See [**waffle\_config**(3)](/waffle_config/3.md) for choices of *context\_api* and expectations for each platform.

**waffle\_display\_get\_native()**

Get the display's underlying native objects. Use [**free**(3)](/free/3.md) to deallocate the returned pointer. See [**waffle\_native**(3)](/waffle_native/3.md) for the definition of **union waffle\_native\_display**.

## RETURN VALUE

Functions whose return type is **bool** return true on success and false on failure. Functions whose return type is a pointer return **NULL** on failure. Use [**waffle\_error\_get\_info**(3)](/waffle_error_get_info/3.md) to get information about any errors.

## ERRORS

See [**waffle\_error**(3)](/waffle_error/3.md) for the complete list of waffle's error codes.

No errors are specific to any of the **waffle\_display** functions.

## ISSUES

Please report bugs or and feature requests to **https://gitlab.freedesktop.org/mesa/waffle/issues**.

## SEE ALSO

[**waffle**(7)](/waffle/7.md)

## AUTHOR

**Chad Versace** \<chad.versace@linux.intel.com\>

Former maintainer

## COPYRIGHT

Copyright © 2013 Intel\

This manual page is licensed under the Creative Commons Attribution-ShareAlike 3.0 United States License (CC BY-SA 3.0). To view a copy of this license, visit **http://creativecommons.org.license/by-sa/3.0/us**.
